Index: apps/gui/wps_debug.c =================================================================== --- apps/gui/wps_debug.c (revision 18358) +++ apps/gui/wps_debug.c (working copy) @@ -25,7 +25,11 @@ #include #include "gwps.h" #ifdef __PCTOOL__ +#ifdef WPSEDITOR +#include "proxy.h" +#else #define DEBUGF printf +#endif #else #include "debug.h" #endif @@ -589,18 +593,18 @@ { char buf[64]; - DEBUGF("Failed parsing on line %d : ", line); + DEBUGF("ERR: Failed parsing on line %d : ", line); switch (fail) { case PARSE_OK: break; case PARSE_FAIL_UNCLOSED_COND: - DEBUGF("Unclosed conditional"); + DEBUGF("ERR: Unclosed conditional"); break; case PARSE_FAIL_INVALID_CHAR: - DEBUGF("unexpected conditional char after token %d: \"%s\"", + DEBUGF("ERR: Unexpected conditional char after token %d: \"%s\"", data->num_tokens-1, get_token_desc(&data->tokens[data->num_tokens-1], data, buf, sizeof(buf)) @@ -608,7 +612,7 @@ break; case PARSE_FAIL_COND_SYNTAX_ERROR: - DEBUGF("Conditional syntax error after token %d: \"%s\"", + DEBUGF("ERR: Conditional syntax error after token %d: \"%s\"", data->num_tokens-1, get_token_desc(&data->tokens[data->num_tokens-1], data, buf, sizeof(buf)) @@ -616,7 +620,7 @@ break; case PARSE_FAIL_COND_INVALID_PARAM: - DEBUGF("Invalid parameter list for token %d: \"%s\"", + DEBUGF("ERR: Invalid parameter list for token %d: \"%s\"", data->num_tokens, get_token_desc(&data->tokens[data->num_tokens], data, buf, sizeof(buf)) @@ -624,7 +628,7 @@ break; case PARSE_FAIL_LIMITS_EXCEEDED: - DEBUGF("Limits exceeded"); + DEBUGF("ERR: Limits exceeded"); break; } DEBUGF("\n"); Index: apps/gui/wps_parser.c =================================================================== --- apps/gui/wps_parser.c (revision 18358) +++ apps/gui/wps_parser.c (working copy) @@ -28,14 +28,25 @@ #include "plugin.h" #ifdef __PCTOOL__ +#if defined(WPSEDITOR) +#include "proxy.h" +#include "settings.h" +#include "sysfont.h" +#include "gwps.h" +#include "font.h" +#include "bmp.h" /*remove warnings*/ +#include "backdrop.h" /*remove warnings*/ +#include "ctype.h" /*remove warnings*/ +#else +#include "checkwps.h" +#define SYSFONT_HEIGHT 8 #define DEBUGF printf +#endif /*WPSEDITOR*/ #define FONT_SYSFIXED 0 #define FONT_UI 1 -#define SYSFONT_HEIGHT 8 -#include "checkwps.h" #else -#include "debug.h" -#endif +# include "debug.h" +#endif /*__PCTOOL__*/ #ifndef __PCTOOL__ #include Index: apps/misc.c =================================================================== --- apps/misc.c (revision 18358) +++ apps/misc.c (working copy) @@ -27,7 +27,10 @@ #ifdef __PCTOOL__ #include #include -#include +#include +#ifdef WPSEDITOR +#include "string.h" /*remove warnings*/ +#endif #else #include "sprintf.h" #include "lang.h" @@ -196,26 +199,6 @@ return buffer; } -/* Format time into buf. - * - * buf - buffer to format to. - * buf_size - size of buffer. - * t - time to format, in milliseconds. - */ -void format_time(char* buf, int buf_size, long t) -{ - if ( t < 3600000 ) - { - snprintf(buf, buf_size, "%d:%02d", - (int) (t / 60000), (int) (t % 60000 / 1000)); - } - else - { - snprintf(buf, buf_size, "%d:%02d:%02d", - (int) (t / 3600000), (int) (t % 3600000 / 60000), - (int) (t % 60000 / 1000)); - } -} #if CONFIG_RTC /* Create a filename with a date+time part. @@ -1179,6 +1162,28 @@ } #endif /* !defined(__PCTOOL__) */ +/* Format time into buf. + * + * buf - buffer to format to. + * buf_size - size of buffer. + * t - time to format, in milliseconds. + */ +void format_time(char* buf, int buf_size, long t) +{ + if ( t < 3600000 ) + { + snprintf(buf, buf_size, "%d:%02d", + (int) (t / 60000), (int) (t % 60000 / 1000)); + } + else + { + snprintf(buf, buf_size, "%d:%02d:%02d", + (int) (t / 3600000), (int) (t % 3600000 / 60000), + (int) (t % 60000 / 1000)); + } +} + + /** Open a UTF-8 file and set file descriptor to first byte after BOM. * If no BOM is present this behaves like open(). * If the file is opened for writing and O_TRUNC is set, write a BOM to Index: apps/settings.h =================================================================== --- apps/settings.h (revision 18358) +++ apps/settings.h (working copy) @@ -51,6 +51,9 @@ /* name of directory where configuration, fonts and other data * files are stored */ #ifdef __PCTOOL__ +#undef ROCKBOX_DIR +#undef ROCKBOX_DIR_LEN +#undef WPS_DIR #define ROCKBOX_DIR "." #define ROCKBOX_DIR_LEN 1 #else Index: firmware/font.c =================================================================== --- firmware/font.c (revision 18358) +++ firmware/font.c (working copy) @@ -522,9 +522,11 @@ { if (fnt_file >= 0) { - - glyph_file = creat(GLYPH_CACHE_FILE); - +#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); Index: firmware/include/dircache.h =================================================================== --- firmware/include/dircache.h (revision 18358) +++ firmware/include/dircache.h (working copy) @@ -21,6 +21,8 @@ #ifndef _DIRCACHE_H #define _DIRCACHE_H +#ifndef WPSEDITOR + #include "dir_uncached.h" #ifdef HAVE_DIRCACHE @@ -118,4 +120,6 @@ int rmdir_cached(const char* name); #endif /* !HAVE_DIRCACHE */ +#endif /*!WPSEDITOR*/ + #endif Index: firmware/include/inttypes.h =================================================================== --- firmware/include/inttypes.h (revision 18358) +++ firmware/include/inttypes.h (working copy) @@ -22,6 +22,8 @@ #ifndef __INTTYPES_H__ #define __INTTYPES_H__ +#ifndef WPSEDITOR + #include /* 8 bit */ @@ -103,5 +105,8 @@ #define uint64_t unsigned long long #endif +#else +#include +#endif /* !WPSEDITOR*/ #endif /* __INTTYPES_H__ */ Index: firmware/include/time.h =================================================================== --- firmware/include/time.h (revision 18358) +++ firmware/include/time.h (working copy) @@ -7,6 +7,11 @@ #ifndef _TIME_H_ #define _TIME_H_ +#ifdef WPSEDITOR +#include +#include +#endif + struct tm { int tm_sec; Index: firmware/mp3data.c =================================================================== --- firmware/mp3data.c (revision 18358) +++ firmware/mp3data.c (working copy) @@ -550,6 +550,7 @@ return bytecount; } +#ifndef __PCTOOL__ static void long2bytes(unsigned char *buf, long val) { buf[0] = (val >> 24) & 0xff; @@ -558,7 +559,6 @@ buf[3] = val & 0xff; } -#ifndef __PCTOOL__ int count_mp3_frames(int fd, int startpos, int filesize, void (*progressfunc)(int)) {