Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

make the parser slightly more usable for rockbox, move the buffer allocation into the lib (maybe not the best spot?)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26880 a1c6a512-1295-4272-9138-f99709370657

+6 -21
+1 -1
lib/skin_parser/Makefile
··· 9 9 10 10 BUILDDIR ?= . 11 11 12 - SRC = skin_parser.c skin_debug.c skin_scan.c tag_table.c 12 + SRC = skin_buffer.c skin_parser.c skin_debug.c skin_scan.c tag_table.c 13 13 OBJ := $(patsubst %.c,$(BUILDDIR)/%.o,$(SRC)) 14 14 OUT = $(BUILDDIR)/libskin_parser.a 15 15 CC = gcc
+5 -20
lib/skin_parser/skin_parser.c
··· 24 24 #include <string.h> 25 25 #include <ctype.h> 26 26 27 + #include "skin_buffer.h" 27 28 #include "skin_parser.h" 28 29 #include "skin_debug.h" 29 30 #include "tag_table.h" 30 31 #include "symbols.h" 31 32 #include "skin_scan.h" 32 - 33 - #ifdef ROCKBOX 34 - /* Declaration of parse tree buffer */ 35 - #define SKIN_MAX_MEMORY (30*1024) 36 - static char skin_parse_tree[SKIN_MAX_MEMORY]; 37 - static char *skin_buffer; 38 - #endif 39 33 40 34 /* Global variables for the parser */ 41 35 int skin_line = 0; ··· 66 60 struct skin_element** to_write = 0; 67 61 68 62 char* cursor = (char*)document; /*Keeps track of location in the document*/ 69 - #ifdef ROCKBOX 70 - /* FIXME */ 71 - skin_buffer = &skin_parse_tree[0]; 72 - #endif 73 - 63 + 74 64 skin_line = 1; 75 65 76 66 skin_clear_errors(); ··· 765 755 static int skin_parse_comment(struct skin_element* element, char** document) 766 756 { 767 757 char* cursor = *document; 758 + #ifndef ROCKBOX 768 759 char* text = NULL; 769 - 760 + #endif 770 761 int length; 771 762 /* 772 763 * Finding the index of the ending newline or null-terminator ··· 847 838 /* Memory management */ 848 839 char* skin_alloc(size_t size) 849 840 { 850 - #ifdef ROCKBOX 851 - char *retval = skin_buffer; 852 - skin_buffer = (void *)(((unsigned long)skin_buffer + 3) & ~3); 853 - return retval; 854 - #else 855 - return malloc(size); 856 - #endif 841 + return skin_buffer_alloc(size); 857 842 } 858 843 859 844 struct skin_element* skin_alloc_element()