summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-08-29 21:08:38 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-08-29 21:08:38 +0000
commit5d22e3cbdd251819a4d2d07b9a12994d5aef778d (patch)
tree4c6a81187ccf065a5f296a903b9f7da88503e403 /firmware
parentcc31b1fbdae455f975b69dd6bffc23d8bd021566 (diff)
downloadrockbox-5d22e3cbdd251819a4d2d07b9a12994d5aef778d.zip
rockbox-5d22e3cbdd251819a4d2d07b9a12994d5aef778d.tar.gz
rockbox-5d22e3cbdd251819a4d2d07b9a12994d5aef778d.tar.bz2
rockbox-5d22e3cbdd251819a4d2d07b9a12994d5aef778d.tar.xz
Add wpseditor, the Google Summer of Code 2008 project of Rostislav Chekan. Closes FS#9327
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18362 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/font.c6
-rw-r--r--firmware/include/inttypes.h5
-rw-r--r--firmware/include/time.h6
-rw-r--r--firmware/mp3data.c2
4 files changed, 16 insertions, 3 deletions
diff --git a/firmware/font.c b/firmware/font.c
index 03e1891..465cec2 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -522,9 +522,11 @@ void glyph_cache_save(void)
{
if (fnt_file >= 0) {
-
+#ifdef WPSEDITOR
+ glyph_file = open(GLYPH_CACHE_FILE, O_WRONLY|O_CREAT|O_TRUNC);
+#else
glyph_file = creat(GLYPH_CACHE_FILE);
-
+#endif
if (glyph_file < 0) return;
lru_traverse(&font_cache_ui._lru, glyph_file_write);
diff --git a/firmware/include/inttypes.h b/firmware/include/inttypes.h
index 1697f69..f7f5099 100644
--- a/firmware/include/inttypes.h
+++ b/firmware/include/inttypes.h
@@ -22,6 +22,8 @@
#ifndef __INTTYPES_H__
#define __INTTYPES_H__
+#ifndef WPSEDITOR
+
#include <limits.h>
/* 8 bit */
@@ -103,5 +105,8 @@
#define uint64_t unsigned long long
#endif
+#else
+#include <stdint.h>
+#endif /* !WPSEDITOR*/
#endif /* __INTTYPES_H__ */
diff --git a/firmware/include/time.h b/firmware/include/time.h
index 23f72fd..9200e82 100644
--- a/firmware/include/time.h
+++ b/firmware/include/time.h
@@ -7,6 +7,11 @@
#ifndef _TIME_H_
#define _TIME_H_
+#ifdef WPSEDITOR
+#include <sys/types.h>
+#include <time.h>
+#endif
+
struct tm
{
int tm_sec;
@@ -34,3 +39,4 @@ struct tm *localtime(const time_t *timep);
#endif /* _TIME_H_ */
+
diff --git a/firmware/mp3data.c b/firmware/mp3data.c
index 25e40f8..80870cd 100644
--- a/firmware/mp3data.c
+++ b/firmware/mp3data.c
@@ -550,6 +550,7 @@ int get_mp3file_info(int fd, struct mp3info *info)
return bytecount;
}
+#ifndef __PCTOOL__
static void long2bytes(unsigned char *buf, long val)
{
buf[0] = (val >> 24) & 0xff;
@@ -558,7 +559,6 @@ static void long2bytes(unsigned char *buf, long val)
buf[3] = val & 0xff;
}
-#ifndef __PCTOOL__
int count_mp3_frames(int fd, int startpos, int filesize,
void (*progressfunc)(int))
{