diff options
author | Björn Stenberg <bjorn@haxx.se> | 2010-06-17 11:04:32 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2010-06-17 11:04:32 +0000 |
commit | f1a144a07772d5683d9e117c4639ad75235fd1bc (patch) | |
tree | a800b4b0133710df9c751c3f81df00fb71422388 | |
parent | db658d98401d23957c8fe88b4bd96ab184f0ffef (diff) | |
download | rockbox-f1a144a07772d5683d9e117c4639ad75235fd1bc.tar.gz rockbox-f1a144a07772d5683d9e117c4639ad75235fd1bc.zip |
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
-rw-r--r-- | lib/skin_parser/SOURCES | 5 | ||||
-rw-r--r-- | lib/skin_parser/skin_buffer.c | 15 | ||||
-rw-r--r-- | lib/skin_parser/skin_debug.c | 2 | ||||
-rw-r--r-- | lib/skin_parser/skin_debug.h | 8 | ||||
-rw-r--r-- | lib/skin_parser/skin_parser.h | 2 | ||||
-rw-r--r-- | lib/skin_parser/skin_parser.make | 20 |
6 files changed, 34 insertions, 18 deletions
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 @@ | |||
1 | skin_buffer.c | ||
2 | skin_parser.c | ||
3 | skin_debug.c | ||
4 | skin_scan.c | ||
5 | 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 @@ | |||
29 | static unsigned char buffer[SKIN_BUFFER_SIZE]; | 29 | static unsigned char buffer[SKIN_BUFFER_SIZE]; |
30 | static unsigned char *buffer_front = NULL; /* start of the free space, | 30 | static unsigned char *buffer_front = NULL; /* start of the free space, |
31 | increases with allocation*/ | 31 | increases with allocation*/ |
32 | static size_t buf_size = SKIN_BUFFER_SIZE; | ||
33 | #endif | 32 | #endif |
34 | 33 | ||
35 | void skin_buffer_init(size_t size) | 34 | void skin_buffer_init(void) |
36 | { | 35 | { |
37 | #if 0 /* this will go in again later probably */ | 36 | #if defined(ROCKBOX) |
38 | if (buffer == NULL) | ||
39 | { | ||
40 | buf_size = SKIN_BUFFER_SIZE;/* global_settings.skin_buf_size */ | ||
41 | |||
42 | buffer = buffer_alloc(buf_size); | ||
43 | buffer_front = buffer; | ||
44 | buffer_back = bufer + buf_size; | ||
45 | } | ||
46 | else | ||
47 | #elif defined(ROCKBOX) | ||
48 | { | 37 | { |
49 | /* reset the buffer.... */ | 38 | /* reset the buffer.... */ |
50 | buffer_front = buffer; | 39 | 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() | |||
99 | error_message = NULL; | 99 | error_message = NULL; |
100 | } | 100 | } |
101 | 101 | ||
102 | #ifndef ROCKBOX | ||
102 | void skin_debug_tree(struct skin_element* root) | 103 | void skin_debug_tree(struct skin_element* root) |
103 | { | 104 | { |
104 | int i; | 105 | int i; |
@@ -260,3 +261,4 @@ void skin_debug_indent() | |||
260 | for(i = 0; i < debug_indent_level; i++) | 261 | for(i = 0; i < debug_indent_level; i++) |
261 | printf(" "); | 262 | printf(" "); |
262 | } | 263 | } |
264 | #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" | |||
32 | 32 | ||
33 | /* Debugging functions */ | 33 | /* Debugging functions */ |
34 | void skin_error(enum skin_errorcode error); | 34 | void skin_error(enum skin_errorcode error); |
35 | int skin_error_line(); | 35 | int skin_error_line(void); |
36 | char* skin_error_message(); | 36 | char* skin_error_message(void); |
37 | void skin_clear_errors(); | 37 | void skin_clear_errors(void); |
38 | void skin_debug_tree(struct skin_element* root); | 38 | void skin_debug_tree(struct skin_element* root); |
39 | 39 | ||
40 | /* Auxiliary debug functions */ | 40 | /* Auxiliary debug functions */ |
41 | void skin_debug_params(int count, struct skin_tag_parameter params[]); | 41 | void skin_debug_params(int count, struct skin_tag_parameter params[]); |
42 | void skin_debug_indent(); | 42 | void skin_debug_indent(void); |
43 | 43 | ||
44 | #ifdef __cplusplus | 44 | #ifdef __cplusplus |
45 | } | 45 | } |
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); | |||
123 | 123 | ||
124 | /* Memory management functions */ | 124 | /* Memory management functions */ |
125 | char *skin_alloc(size_t size); | 125 | char *skin_alloc(size_t size); |
126 | struct skin_element* skin_alloc_element(); | 126 | struct skin_element* skin_alloc_element(void); |
127 | struct skin_element** skin_alloc_children(int count); | 127 | struct skin_element** skin_alloc_children(int count); |
128 | struct skin_tag_parameter* skin_alloc_params(int count); | 128 | struct skin_tag_parameter* skin_alloc_params(int count); |
129 | char* skin_alloc_string(int length); | 129 | 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 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # | ||
8 | SKINP_DIR = $(ROOTDIR)/lib/skin_parser | ||
9 | SKINP_SRC = $(call preprocess, $(SKINP_DIR)/SOURCES) | ||
10 | SKINP_OBJ := $(call c2obj, $(SKINP_SRC)) | ||
11 | |||
12 | OTHER_SRC += $(SKINP_SRC) | ||
13 | |||
14 | SKINLIB = $(BUILDDIR)/libskin_parser.a | ||
15 | |||
16 | INCLUDES += -I$(SKINP_DIR) | ||
17 | |||
18 | $(SKINLIB): $(SKINP_OBJ) | ||
19 | $(SILENT)$(shell rm -f $@) | ||
20 | $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null | ||