udelay between command and data write seems to get rid of the display glitches on...
[kugel-rb.git] / utils / newparser / newparser.c
blobf56fe6db8492e23f06944ebef397ba122d838744
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: tag_table.c 26346 2010-05-28 02:30:27Z jdgordon $
10 * Copyright (C) 2010 Jonathan Gordon
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <stdbool.h>
25 #include <string.h>
26 #include <ctype.h>
28 #include "skin_parser.h"
29 #include "tag_table.h"
30 #include "skin_structs.h"
32 int handle_tree(struct skin *skin, struct skin_element* tree, struct line* line);
33 void skin_render(struct skin_element* root);
35 int main(int argc, char* argv[])
37 char buffer[10*1024], temp[512];
38 FILE *in;
39 int filearg = 1, i=0;
40 if( (argc < 2) ||
41 strcmp(argv[1],"-h") == 0 ||
42 strcmp(argv[1],"--help") == 0 )
44 printf("Usage: %s infile \n", argv[0]);
45 return 0;
48 while ((argc > filearg) && argv[filearg][0] == '-')
50 i=1;
51 while (argv[filearg][i])
53 switch(argv[filearg][i])
56 i++;
58 filearg++;
60 if (argc == filearg)
62 printf("Missing input filename\n");
63 return 1;
66 in = fopen(argv[filearg], "r");
67 if (!in)
68 return 1;
69 while (fgets(temp, 512, in))
70 strcat(buffer, temp);
71 fclose(in);
72 filearg++;
74 struct skin_element* tree = skin_parse(buffer);
75 struct skin skin;
76 handle_tree(&skin, tree, NULL);
77 skin_render(tree);
79 skin_free_tree(tree);
80 return 0;