summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/skin_parser/SOURCES5
-rw-r--r--lib/skin_parser/skin_buffer.c15
-rw-r--r--lib/skin_parser/skin_debug.c2
-rw-r--r--lib/skin_parser/skin_debug.h8
-rw-r--r--lib/skin_parser/skin_parser.h2
-rw-r--r--lib/skin_parser/skin_parser.make20
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 @@
1skin_buffer.c
2skin_parser.c
3skin_debug.c
4skin_scan.c
5tag_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 @@
29static unsigned char buffer[SKIN_BUFFER_SIZE]; 29static unsigned char buffer[SKIN_BUFFER_SIZE];
30static unsigned char *buffer_front = NULL; /* start of the free space, 30static unsigned char *buffer_front = NULL; /* start of the free space,
31 increases with allocation*/ 31 increases with allocation*/
32static size_t buf_size = SKIN_BUFFER_SIZE;
33#endif 32#endif
34 33
35void skin_buffer_init(size_t size) 34void 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
102void skin_debug_tree(struct skin_element* root) 103void 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 */
34void skin_error(enum skin_errorcode error); 34void skin_error(enum skin_errorcode error);
35int skin_error_line(); 35int skin_error_line(void);
36char* skin_error_message(); 36char* skin_error_message(void);
37void skin_clear_errors(); 37void skin_clear_errors(void);
38void skin_debug_tree(struct skin_element* root); 38void skin_debug_tree(struct skin_element* root);
39 39
40/* Auxiliary debug functions */ 40/* Auxiliary debug functions */
41void skin_debug_params(int count, struct skin_tag_parameter params[]); 41void skin_debug_params(int count, struct skin_tag_parameter params[]);
42void skin_debug_indent(); 42void 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 */
125char *skin_alloc(size_t size); 125char *skin_alloc(size_t size);
126struct skin_element* skin_alloc_element(); 126struct skin_element* skin_alloc_element(void);
127struct skin_element** skin_alloc_children(int count); 127struct skin_element** skin_alloc_children(int count);
128struct skin_tag_parameter* skin_alloc_params(int count); 128struct skin_tag_parameter* skin_alloc_params(int count);
129char* skin_alloc_string(int length); 129char* 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#
8SKINP_DIR = $(ROOTDIR)/lib/skin_parser
9SKINP_SRC = $(call preprocess, $(SKINP_DIR)/SOURCES)
10SKINP_OBJ := $(call c2obj, $(SKINP_SRC))
11
12OTHER_SRC += $(SKINP_SRC)
13
14SKINLIB = $(BUILDDIR)/libskin_parser.a
15
16INCLUDES += -I$(SKINP_DIR)
17
18$(SKINLIB): $(SKINP_OBJ)
19 $(SILENT)$(shell rm -f $@)
20 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null