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