From f1a144a07772d5683d9e117c4639ad75235fd1bc Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Thu, 17 Jun 2010 11:04:32 +0000 Subject: Added skin_parser library to build system. Fixed some warnings. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26884 a1c6a512-1295-4272-9138-f99709370657 --- lib/skin_parser/SOURCES | 5 +++++ lib/skin_parser/skin_buffer.c | 15 ++------------- lib/skin_parser/skin_debug.c | 2 ++ lib/skin_parser/skin_debug.h | 8 ++++---- lib/skin_parser/skin_parser.h | 2 +- lib/skin_parser/skin_parser.make | 20 ++++++++++++++++++++ 6 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 lib/skin_parser/SOURCES create mode 100644 lib/skin_parser/skin_parser.make diff --git a/lib/skin_parser/SOURCES b/lib/skin_parser/SOURCES new file mode 100644 index 0000000000..d99e63cd3b --- /dev/null +++ b/lib/skin_parser/SOURCES @@ -0,0 +1,5 @@ +skin_buffer.c +skin_parser.c +skin_debug.c +skin_scan.c +tag_table.c diff --git a/lib/skin_parser/skin_buffer.c b/lib/skin_parser/skin_buffer.c index 8a5a47ddba..b0910976e2 100644 --- a/lib/skin_parser/skin_buffer.c +++ b/lib/skin_parser/skin_buffer.c @@ -29,22 +29,11 @@ static unsigned char buffer[SKIN_BUFFER_SIZE]; static unsigned char *buffer_front = NULL; /* start of the free space, increases with allocation*/ -static size_t buf_size = SKIN_BUFFER_SIZE; #endif -void skin_buffer_init(size_t size) +void skin_buffer_init(void) { -#if 0 /* this will go in again later probably */ - if (buffer == NULL) - { - buf_size = SKIN_BUFFER_SIZE;/* global_settings.skin_buf_size */ - - buffer = buffer_alloc(buf_size); - buffer_front = buffer; - buffer_back = bufer + buf_size; - } - else -#elif defined(ROCKBOX) +#if defined(ROCKBOX) { /* reset the buffer.... */ buffer_front = buffer; diff --git a/lib/skin_parser/skin_debug.c b/lib/skin_parser/skin_debug.c index 549f7b9e6c..496268f3cf 100644 --- a/lib/skin_parser/skin_debug.c +++ b/lib/skin_parser/skin_debug.c @@ -99,6 +99,7 @@ void skin_clear_errors() error_message = NULL; } +#ifndef ROCKBOX void skin_debug_tree(struct skin_element* root) { int i; @@ -260,3 +261,4 @@ void skin_debug_indent() for(i = 0; i < debug_indent_level; i++) printf(" "); } +#endif diff --git a/lib/skin_parser/skin_debug.h b/lib/skin_parser/skin_debug.h index a550dc4c7b..1c096ce952 100644 --- a/lib/skin_parser/skin_debug.h +++ b/lib/skin_parser/skin_debug.h @@ -32,14 +32,14 @@ extern "C" /* Debugging functions */ void skin_error(enum skin_errorcode error); -int skin_error_line(); -char* skin_error_message(); -void skin_clear_errors(); +int skin_error_line(void); +char* skin_error_message(void); +void skin_clear_errors(void); void skin_debug_tree(struct skin_element* root); /* Auxiliary debug functions */ void skin_debug_params(int count, struct skin_tag_parameter params[]); -void skin_debug_indent(); +void skin_debug_indent(void); #ifdef __cplusplus } diff --git a/lib/skin_parser/skin_parser.h b/lib/skin_parser/skin_parser.h index 1fc4a7ae6b..ec0f3b9bfc 100644 --- a/lib/skin_parser/skin_parser.h +++ b/lib/skin_parser/skin_parser.h @@ -123,7 +123,7 @@ struct skin_element* skin_parse(const char* document); /* Memory management functions */ char *skin_alloc(size_t size); -struct skin_element* skin_alloc_element(); +struct skin_element* skin_alloc_element(void); struct skin_element** skin_alloc_children(int count); struct skin_tag_parameter* skin_alloc_params(int count); char* skin_alloc_string(int length); diff --git a/lib/skin_parser/skin_parser.make b/lib/skin_parser/skin_parser.make new file mode 100644 index 0000000000..c73fc6ef00 --- /dev/null +++ b/lib/skin_parser/skin_parser.make @@ -0,0 +1,20 @@ +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# +SKINP_DIR = $(ROOTDIR)/lib/skin_parser +SKINP_SRC = $(call preprocess, $(SKINP_DIR)/SOURCES) +SKINP_OBJ := $(call c2obj, $(SKINP_SRC)) + +OTHER_SRC += $(SKINP_SRC) + +SKINLIB = $(BUILDDIR)/libskin_parser.a + +INCLUDES += -I$(SKINP_DIR) + +$(SKINLIB): $(SKINP_OBJ) + $(SILENT)$(shell rm -f $@) + $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null -- cgit v1.2.3