From cb2de174c14389b7846fa14c0b1bcc37c3c72f31 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 7 Feb 2003 10:13:23 +0000 Subject: more moves git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3221 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/atoi.h | 25 ------- firmware/common/dir.h | 81 -------------------- firmware/common/disk.h | 35 --------- firmware/common/errno.h | 134 ---------------------------------- firmware/common/file.h | 76 ------------------- firmware/common/sprintf.h | 29 -------- firmware/common/timefuncs.h | 44 ----------- firmware/drivers/lcd-player-charset.h | 27 ------- firmware/export/lcd-player-charset.h | 27 +++++++ firmware/include/atoi.h | 25 +++++++ firmware/include/dir.h | 81 ++++++++++++++++++++ firmware/include/errno.h | 134 ++++++++++++++++++++++++++++++++++ firmware/include/file.h | 76 +++++++++++++++++++ firmware/include/sprintf.h | 29 ++++++++ firmware/include/timefuncs.h | 44 +++++++++++ 15 files changed, 416 insertions(+), 451 deletions(-) delete mode 100644 firmware/common/atoi.h delete mode 100644 firmware/common/dir.h delete mode 100644 firmware/common/disk.h delete mode 100644 firmware/common/errno.h delete mode 100644 firmware/common/file.h delete mode 100644 firmware/common/sprintf.h delete mode 100644 firmware/common/timefuncs.h delete mode 100644 firmware/drivers/lcd-player-charset.h create mode 100644 firmware/export/lcd-player-charset.h create mode 100644 firmware/include/atoi.h create mode 100644 firmware/include/dir.h create mode 100644 firmware/include/errno.h create mode 100644 firmware/include/file.h create mode 100644 firmware/include/sprintf.h create mode 100644 firmware/include/timefuncs.h diff --git a/firmware/common/atoi.h b/firmware/common/atoi.h deleted file mode 100644 index 118879622b..0000000000 --- a/firmware/common/atoi.h +++ /dev/null @@ -1,25 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2002 by Felix Arends - * - * 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. - * - ****************************************************************************/ - -#ifndef __ATOI_H__ -#define __ATOI_H__ - -int atoi (const char *str); - -#endif /* __ATOI_H__ */ diff --git a/firmware/common/dir.h b/firmware/common/dir.h deleted file mode 100644 index 6b275abda8..0000000000 --- a/firmware/common/dir.h +++ /dev/null @@ -1,81 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2002 by Björn Stenberg - * - * 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. - * - ****************************************************************************/ -#ifndef _DIR_H_ -#define _DIR_H_ - -#include -#include "file.h" - -#ifndef DIRENT_DEFINED - -#define ATTR_READ_ONLY 0x01 -#define ATTR_HIDDEN 0x02 -#define ATTR_SYSTEM 0x04 -#define ATTR_VOLUME_ID 0x08 -#define ATTR_DIRECTORY 0x10 -#define ATTR_ARCHIVE 0x20 - -struct dirent { - unsigned char d_name[MAX_PATH]; - int attribute; - int size; - int startcluster; -}; -#endif - - -#ifndef SIMULATOR - -#include "fat.h" - -typedef struct { - bool busy; - int startcluster; - struct fat_dir fatdir; - struct dirent theent; -} DIR; - -#else // SIMULATOR - -#ifdef WIN32 -#ifndef __MINGW32__ -#include -#endif /* __MINGW32__ */ - -typedef struct DIRtag -{ - struct dirent fd; - int handle; -} DIR; - -#endif /* WIN32 */ - -#endif // SIMULATOR - -#ifndef DIRFUNCTIONS_DEFINED - -extern DIR* opendir(char* name); -extern int closedir(DIR* dir); -extern int mkdir(char* name); - -extern struct dirent* readdir(DIR* dir); - -#endif /* DIRFUNCTIONS_DEFINED */ - -#endif diff --git a/firmware/common/disk.h b/firmware/common/disk.h deleted file mode 100644 index 865b7bb4b4..0000000000 --- a/firmware/common/disk.h +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2002 by Björn Stenberg - * - * 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. - * - ****************************************************************************/ -#ifndef _DISK_H_ -#define _DISK_H_ - -struct partinfo { - unsigned long start; /* first sector (LBA) */ - unsigned long size; /* number of sectors */ - unsigned char type; -}; - -#define PARTITION_TYPE_FAT32 0x0b -#define PARTITION_TYPE_FAT32_LBA 0x0c - -/* returns a pointer to an array of 8 partinfo structs */ -struct partinfo* disk_init(void); -struct partinfo* disk_partinfo(int partition); - -#endif diff --git a/firmware/common/errno.h b/firmware/common/errno.h deleted file mode 100644 index 4162f6a9ed..0000000000 --- a/firmware/common/errno.h +++ /dev/null @@ -1,134 +0,0 @@ -/* errno is not a global variable, because that would make using it - non-reentrant. Instead, its address is returned by the function - __errno. */ - -#ifndef _SYS_ERRNO_H_ - -extern int errno; - -#define EPERM 1 /* Not super-user */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No children */ -#define EAGAIN 11 /* No more processes */ -#define ENOMEM 12 /* Not enough core */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#define ENOTBLK 15 /* Block device required */ -#define EBUSY 16 /* Mount device busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* Too many open files in system */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Not a typewriter */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Math arg out of domain of func */ -#define ERANGE 34 /* Math result not representable */ -#define ENOMSG 35 /* No message of desired type */ -#define EIDRM 36 /* Identifier removed */ -#define ECHRNG 37 /* Channel number out of range */ -#define EL2NSYNC 38 /* Level 2 not synchronized */ -#define EL3HLT 39 /* Level 3 halted */ -#define EL3RST 40 /* Level 3 reset */ -#define ELNRNG 41 /* Link number out of range */ -#define EUNATCH 42 /* Protocol driver not attached */ -#define ENOCSI 43 /* No CSI structure available */ -#define EL2HLT 44 /* Level 2 halted */ -#define EDEADLK 45 /* Deadlock condition */ -#define ENOLCK 46 /* No record locks available */ -#define EBADE 50 /* Invalid exchange */ -#define EBADR 51 /* Invalid request descriptor */ -#define EXFULL 52 /* Exchange full */ -#define ENOANO 53 /* No anode */ -#define EBADRQC 54 /* Invalid request code */ -#define EBADSLT 55 /* Invalid slot */ -#define EDEADLOCK 56 /* File locking deadlock error */ -#define EBFONT 57 /* Bad font file fmt */ -#define ENOSTR 60 /* Device not a stream */ -#define ENODATA 61 /* No data (for no delay io) */ -#define ETIME 62 /* Timer expired */ -#define ENOSR 63 /* Out of streams resources */ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* The object is remote */ -#define ENOLINK 67 /* The link has been severed */ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 74 /* Multihop attempted */ -#define ELBIN 75 /* Inode is remote (not really error) */ -#define EDOTDOT 76 /* Cross mount point (not really error) */ -#define EBADMSG 77 /* Trying to read unreadable message */ -#define ENOTUNIQ 80 /* Given log. name not unique */ -#define EBADFD 81 /* f.d. invalid for this operation */ -#define EREMCHG 82 /* Remote address changed */ -#define ELIBACC 83 /* Can't access a needed shared lib */ -#define ELIBBAD 84 /* Accessing a corrupted shared lib */ -#define ELIBSCN 85 /* .lib section in a.out corrupted */ -#define ELIBMAX 86 /* Attempting to link in too many libs */ -#define ELIBEXEC 87 /* Attempting to exec a shared library */ -#define ENOSYS 88 /* Function not implemented */ -#define ENMFILE 89 /* No more files */ -#define ENOTEMPTY 90 /* Directory not empty */ -#define ENAMETOOLONG 91 /* File or path name too long */ -#define ELOOP 92 /* Too many symbolic links */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ -#define EPROTOTYPE 107 /* Protocol wrong type for socket */ -#define ENOTSOCK 108 /* Socket operation on non-socket */ -#define ENOPROTOOPT 109 /* Protocol not available */ -#define ESHUTDOWN 110 /* Can't send after socket shutdown */ -#define ECONNREFUSED 111 /* Connection refused */ -#define EADDRINUSE 112 /* Address already in use */ -#define ECONNABORTED 113 /* Connection aborted */ -#define ENETUNREACH 114 /* Network is unreachable */ -#define ENETDOWN 115 /* Network interface is not configured */ -#define ETIMEDOUT 116 /* Connection timed out */ -#define EHOSTDOWN 117 /* Host is down */ -#define EHOSTUNREACH 118 /* Host is unreachable */ -#define EINPROGRESS 119 /* Connection already in progress */ -#define EALREADY 120 /* Socket already connected */ -#define EDESTADDRREQ 121 /* Destination address required */ -#define EMSGSIZE 122 /* Message too long */ -#define EPROTONOSUPPORT 123 /* Unknown protocol */ -#define ESOCKTNOSUPPORT 124 /* Socket type not supported */ -#define EADDRNOTAVAIL 125 /* Address not available */ -#define ENETRESET 126 -#define EISCONN 127 /* Socket is already connected */ -#define ENOTCONN 128 /* Socket is not connected */ -#define ETOOMANYREFS 129 -#define EPROCLIM 130 -#define EUSERS 131 -#define EDQUOT 132 -#define ESTALE 133 -#define ENOTSUP 134 /* Not supported */ -#define ENOMEDIUM 135 /* No medium (in tape drive) */ -#define ENOSHARE 136 /* No such host or network path */ -#define ECASECLASH 137 /* Filename exists with different case */ - -/* From cygwin32. */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ - -#define __ELASTERROR 2000 /* Users can add values starting here */ - -#endif /* _SYS_ERRNO_H */ diff --git a/firmware/common/file.h b/firmware/common/file.h deleted file mode 100644 index ff70c017be..0000000000 --- a/firmware/common/file.h +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2002 by Björn Stenberg - * - * 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. - * - ****************************************************************************/ - -#ifndef _FILE_H_ -#define _FILE_H_ - -#undef MAX_PATH /* this avoids problems when building simulator */ -#define MAX_PATH 260 - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#ifndef O_RDONLY -#define O_RDONLY 0 -#define O_WRONLY 1 -#define O_RDWR 2 -#define O_CREAT 4 -#define O_APPEND 8 -#define O_TRUNC 0x10 -#endif - -#if defined(__MINGW32__) && defined(SIMULATOR) -extern int open(const char*, int, ...); -extern int close(int fd); -extern int read(int, void*, unsigned int); -extern long lseek(int, long, int); -extern int creat(const char *, int); -extern int write(int, const void*, unsigned int); -extern int remove(const char*); - -#else - -#ifndef SIMULATOR -extern int open(const char* pathname, int flags); -extern int close(int fd); -extern int read(int fd, void* buf, int count); -extern int lseek(int fd, int offset, int whence); -extern int creat(const char *pathname, int mode); -extern int write(int fd, void* buf, int count); -extern int remove(const char* pathname); -extern int rename(const char* path, const char* newname); -extern int ftruncate(int fd, unsigned int size); - -#else -#ifdef WIN32 -#include -#include -#endif /* WIN32 */ -#endif /* SIMULATOR */ - -#endif /* __MINGW32__ */ - -#endif diff --git a/firmware/common/sprintf.h b/firmware/common/sprintf.h deleted file mode 100644 index ecbbc8a419..0000000000 --- a/firmware/common/sprintf.h +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2002 by Felix Arends - * - * 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. - * - ****************************************************************************/ - -#ifndef __SPRINTF_H__ -#define __SPRINTF_H__ - -#include -#include - -int snprintf (char *buf, size_t size, const char *fmt, ...); -int vsnprintf (char *buf, int size, const char *fmt, va_list ap); - -#endif /* __SPRINTF_H__ */ diff --git a/firmware/common/timefuncs.h b/firmware/common/timefuncs.h deleted file mode 100644 index 3845b946c5..0000000000 --- a/firmware/common/timefuncs.h +++ /dev/null @@ -1,44 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2002 by Linus Nielsen Feltzing - * - * 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. - * - ****************************************************************************/ - -#ifndef _TIMEFUNCS_H_ -#define _TIMEFUNCS_H_ - -#include "config.h" - -#ifndef SIMULATOR - -struct tm -{ - int tm_sec; /* seconds */ - int tm_min; /* minutes */ - int tm_hour; /* hours */ - int tm_mday; /* day of the month */ - int tm_mon; /* month */ - int tm_year; /* year since 1900 */ - int tm_wday; /* day of the week */ - int tm_yday; /* day in the year */ - int tm_isdst; /* daylight saving time */ -}; - -#endif - -struct tm *get_time(void); - -#endif /* _TIMEFUNCS_H_ */ diff --git a/firmware/drivers/lcd-player-charset.h b/firmware/drivers/lcd-player-charset.h deleted file mode 100644 index 2789f8da70..0000000000 --- a/firmware/drivers/lcd-player-charset.h +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2003 by Kjell Ericson - * - * 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. - * - ****************************************************************************/ -#ifdef HAVE_LCD_CHARCELLS - -#define NO_EXTENDED_LCD_CHARS 0x5e -#define RESERVED_CHAR 0xff -#define LAST_RESERVED_CHAR 0x17 -#define NOCHAR_OLD 0x24 -#define NOCHAR_NEW 0x20 - -#endif diff --git a/firmware/export/lcd-player-charset.h b/firmware/export/lcd-player-charset.h new file mode 100644 index 0000000000..2789f8da70 --- /dev/null +++ b/firmware/export/lcd-player-charset.h @@ -0,0 +1,27 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2003 by Kjell Ericson + * + * 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. + * + ****************************************************************************/ +#ifdef HAVE_LCD_CHARCELLS + +#define NO_EXTENDED_LCD_CHARS 0x5e +#define RESERVED_CHAR 0xff +#define LAST_RESERVED_CHAR 0x17 +#define NOCHAR_OLD 0x24 +#define NOCHAR_NEW 0x20 + +#endif diff --git a/firmware/include/atoi.h b/firmware/include/atoi.h new file mode 100644 index 0000000000..118879622b --- /dev/null +++ b/firmware/include/atoi.h @@ -0,0 +1,25 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Felix Arends + * + * 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. + * + ****************************************************************************/ + +#ifndef __ATOI_H__ +#define __ATOI_H__ + +int atoi (const char *str); + +#endif /* __ATOI_H__ */ diff --git a/firmware/include/dir.h b/firmware/include/dir.h new file mode 100644 index 0000000000..6b275abda8 --- /dev/null +++ b/firmware/include/dir.h @@ -0,0 +1,81 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Björn Stenberg + * + * 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. + * + ****************************************************************************/ +#ifndef _DIR_H_ +#define _DIR_H_ + +#include +#include "file.h" + +#ifndef DIRENT_DEFINED + +#define ATTR_READ_ONLY 0x01 +#define ATTR_HIDDEN 0x02 +#define ATTR_SYSTEM 0x04 +#define ATTR_VOLUME_ID 0x08 +#define ATTR_DIRECTORY 0x10 +#define ATTR_ARCHIVE 0x20 + +struct dirent { + unsigned char d_name[MAX_PATH]; + int attribute; + int size; + int startcluster; +}; +#endif + + +#ifndef SIMULATOR + +#include "fat.h" + +typedef struct { + bool busy; + int startcluster; + struct fat_dir fatdir; + struct dirent theent; +} DIR; + +#else // SIMULATOR + +#ifdef WIN32 +#ifndef __MINGW32__ +#include +#endif /* __MINGW32__ */ + +typedef struct DIRtag +{ + struct dirent fd; + int handle; +} DIR; + +#endif /* WIN32 */ + +#endif // SIMULATOR + +#ifndef DIRFUNCTIONS_DEFINED + +extern DIR* opendir(char* name); +extern int closedir(DIR* dir); +extern int mkdir(char* name); + +extern struct dirent* readdir(DIR* dir); + +#endif /* DIRFUNCTIONS_DEFINED */ + +#endif diff --git a/firmware/include/errno.h b/firmware/include/errno.h new file mode 100644 index 0000000000..4162f6a9ed --- /dev/null +++ b/firmware/include/errno.h @@ -0,0 +1,134 @@ +/* errno is not a global variable, because that would make using it + non-reentrant. Instead, its address is returned by the function + __errno. */ + +#ifndef _SYS_ERRNO_H_ + +extern int errno; + +#define EPERM 1 /* Not super-user */ +#define ENOENT 2 /* No such file or directory */ +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted system call */ +#define EIO 5 /* I/O error */ +#define ENXIO 6 /* No such device or address */ +#define E2BIG 7 /* Arg list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file number */ +#define ECHILD 10 /* No children */ +#define EAGAIN 11 /* No more processes */ +#define ENOMEM 12 /* Not enough core */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +#define ENOTBLK 15 /* Block device required */ +#define EBUSY 16 /* Mount device busy */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Cross-device link */ +#define ENODEV 19 /* No such device */ +#define ENOTDIR 20 /* Not a directory */ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* Too many open files in system */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Not a typewriter */ +#define ETXTBSY 26 /* Text file busy */ +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Illegal seek */ +#define EROFS 30 /* Read only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ +#define EDOM 33 /* Math arg out of domain of func */ +#define ERANGE 34 /* Math result not representable */ +#define ENOMSG 35 /* No message of desired type */ +#define EIDRM 36 /* Identifier removed */ +#define ECHRNG 37 /* Channel number out of range */ +#define EL2NSYNC 38 /* Level 2 not synchronized */ +#define EL3HLT 39 /* Level 3 halted */ +#define EL3RST 40 /* Level 3 reset */ +#define ELNRNG 41 /* Link number out of range */ +#define EUNATCH 42 /* Protocol driver not attached */ +#define ENOCSI 43 /* No CSI structure available */ +#define EL2HLT 44 /* Level 2 halted */ +#define EDEADLK 45 /* Deadlock condition */ +#define ENOLCK 46 /* No record locks available */ +#define EBADE 50 /* Invalid exchange */ +#define EBADR 51 /* Invalid request descriptor */ +#define EXFULL 52 /* Exchange full */ +#define ENOANO 53 /* No anode */ +#define EBADRQC 54 /* Invalid request code */ +#define EBADSLT 55 /* Invalid slot */ +#define EDEADLOCK 56 /* File locking deadlock error */ +#define EBFONT 57 /* Bad font file fmt */ +#define ENOSTR 60 /* Device not a stream */ +#define ENODATA 61 /* No data (for no delay io) */ +#define ETIME 62 /* Timer expired */ +#define ENOSR 63 /* Out of streams resources */ +#define ENONET 64 /* Machine is not on the network */ +#define ENOPKG 65 /* Package not installed */ +#define EREMOTE 66 /* The object is remote */ +#define ENOLINK 67 /* The link has been severed */ +#define EADV 68 /* Advertise error */ +#define ESRMNT 69 /* Srmount error */ +#define ECOMM 70 /* Communication error on send */ +#define EPROTO 71 /* Protocol error */ +#define EMULTIHOP 74 /* Multihop attempted */ +#define ELBIN 75 /* Inode is remote (not really error) */ +#define EDOTDOT 76 /* Cross mount point (not really error) */ +#define EBADMSG 77 /* Trying to read unreadable message */ +#define ENOTUNIQ 80 /* Given log. name not unique */ +#define EBADFD 81 /* f.d. invalid for this operation */ +#define EREMCHG 82 /* Remote address changed */ +#define ELIBACC 83 /* Can't access a needed shared lib */ +#define ELIBBAD 84 /* Accessing a corrupted shared lib */ +#define ELIBSCN 85 /* .lib section in a.out corrupted */ +#define ELIBMAX 86 /* Attempting to link in too many libs */ +#define ELIBEXEC 87 /* Attempting to exec a shared library */ +#define ENOSYS 88 /* Function not implemented */ +#define ENMFILE 89 /* No more files */ +#define ENOTEMPTY 90 /* Directory not empty */ +#define ENAMETOOLONG 91 /* File or path name too long */ +#define ELOOP 92 /* Too many symbolic links */ +#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ +#define EPFNOSUPPORT 96 /* Protocol family not supported */ +#define ECONNRESET 104 /* Connection reset by peer */ +#define ENOBUFS 105 /* No buffer space available */ +#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ +#define EPROTOTYPE 107 /* Protocol wrong type for socket */ +#define ENOTSOCK 108 /* Socket operation on non-socket */ +#define ENOPROTOOPT 109 /* Protocol not available */ +#define ESHUTDOWN 110 /* Can't send after socket shutdown */ +#define ECONNREFUSED 111 /* Connection refused */ +#define EADDRINUSE 112 /* Address already in use */ +#define ECONNABORTED 113 /* Connection aborted */ +#define ENETUNREACH 114 /* Network is unreachable */ +#define ENETDOWN 115 /* Network interface is not configured */ +#define ETIMEDOUT 116 /* Connection timed out */ +#define EHOSTDOWN 117 /* Host is down */ +#define EHOSTUNREACH 118 /* Host is unreachable */ +#define EINPROGRESS 119 /* Connection already in progress */ +#define EALREADY 120 /* Socket already connected */ +#define EDESTADDRREQ 121 /* Destination address required */ +#define EMSGSIZE 122 /* Message too long */ +#define EPROTONOSUPPORT 123 /* Unknown protocol */ +#define ESOCKTNOSUPPORT 124 /* Socket type not supported */ +#define EADDRNOTAVAIL 125 /* Address not available */ +#define ENETRESET 126 +#define EISCONN 127 /* Socket is already connected */ +#define ENOTCONN 128 /* Socket is not connected */ +#define ETOOMANYREFS 129 +#define EPROCLIM 130 +#define EUSERS 131 +#define EDQUOT 132 +#define ESTALE 133 +#define ENOTSUP 134 /* Not supported */ +#define ENOMEDIUM 135 /* No medium (in tape drive) */ +#define ENOSHARE 136 /* No such host or network path */ +#define ECASECLASH 137 /* Filename exists with different case */ + +/* From cygwin32. */ +#define EWOULDBLOCK EAGAIN /* Operation would block */ + +#define __ELASTERROR 2000 /* Users can add values starting here */ + +#endif /* _SYS_ERRNO_H */ diff --git a/firmware/include/file.h b/firmware/include/file.h new file mode 100644 index 0000000000..ff70c017be --- /dev/null +++ b/firmware/include/file.h @@ -0,0 +1,76 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Björn Stenberg + * + * 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. + * + ****************************************************************************/ + +#ifndef _FILE_H_ +#define _FILE_H_ + +#undef MAX_PATH /* this avoids problems when building simulator */ +#define MAX_PATH 260 + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef O_RDONLY +#define O_RDONLY 0 +#define O_WRONLY 1 +#define O_RDWR 2 +#define O_CREAT 4 +#define O_APPEND 8 +#define O_TRUNC 0x10 +#endif + +#if defined(__MINGW32__) && defined(SIMULATOR) +extern int open(const char*, int, ...); +extern int close(int fd); +extern int read(int, void*, unsigned int); +extern long lseek(int, long, int); +extern int creat(const char *, int); +extern int write(int, const void*, unsigned int); +extern int remove(const char*); + +#else + +#ifndef SIMULATOR +extern int open(const char* pathname, int flags); +extern int close(int fd); +extern int read(int fd, void* buf, int count); +extern int lseek(int fd, int offset, int whence); +extern int creat(const char *pathname, int mode); +extern int write(int fd, void* buf, int count); +extern int remove(const char* pathname); +extern int rename(const char* path, const char* newname); +extern int ftruncate(int fd, unsigned int size); + +#else +#ifdef WIN32 +#include +#include +#endif /* WIN32 */ +#endif /* SIMULATOR */ + +#endif /* __MINGW32__ */ + +#endif diff --git a/firmware/include/sprintf.h b/firmware/include/sprintf.h new file mode 100644 index 0000000000..ecbbc8a419 --- /dev/null +++ b/firmware/include/sprintf.h @@ -0,0 +1,29 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Felix Arends + * + * 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. + * + ****************************************************************************/ + +#ifndef __SPRINTF_H__ +#define __SPRINTF_H__ + +#include +#include + +int snprintf (char *buf, size_t size, const char *fmt, ...); +int vsnprintf (char *buf, int size, const char *fmt, va_list ap); + +#endif /* __SPRINTF_H__ */ diff --git a/firmware/include/timefuncs.h b/firmware/include/timefuncs.h new file mode 100644 index 0000000000..3845b946c5 --- /dev/null +++ b/firmware/include/timefuncs.h @@ -0,0 +1,44 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Linus Nielsen Feltzing + * + * 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. + * + ****************************************************************************/ + +#ifndef _TIMEFUNCS_H_ +#define _TIMEFUNCS_H_ + +#include "config.h" + +#ifndef SIMULATOR + +struct tm +{ + int tm_sec; /* seconds */ + int tm_min; /* minutes */ + int tm_hour; /* hours */ + int tm_mday; /* day of the month */ + int tm_mon; /* month */ + int tm_year; /* year since 1900 */ + int tm_wday; /* day of the week */ + int tm_yday; /* day in the year */ + int tm_isdst; /* daylight saving time */ +}; + +#endif + +struct tm *get_time(void); + +#endif /* _TIMEFUNCS_H_ */ -- cgit v1.2.3