1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 * $Id: tag_table.c 26297 2010-05-26 03:53:06Z jdgordon $
10 * Copyright (C) 2010 Robert Bieber
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 "tag_table.h"
26 /* The tag definition table */
27 struct tag_info legal_tags
[] =
176 { "C" , "important"},
185 { "Vl" , "SIIiii|ii"},
186 { "Vi" , "sIIiii|ii"},
210 { "" , ""} /* Keep this here to mark the end of the table */
213 /* A table of legal escapable characters */
214 char legal_escape_characters
[] = "%(,);#<|>";
217 * Just does a straight search through the tag table to find one by
220 char* find_tag(char* name
)
223 struct tag_info
* current
= legal_tags
;
226 * Continue searching so long as we have a non-empty name string
227 * and the name of the current element doesn't match the name
228 * we're searching for
231 while(strcmp(current
->name
, name
) && current
->name
[0] != '\0')
234 if(current
->name
[0] == '\0')
237 return current
->params
;
241 /* Searches through the legal escape characters string */
242 int find_escape_character(char lookup
)
244 char* current
= legal_escape_characters
;
245 while(*current
!= lookup
&& *current
!= '\0')
248 if(*current
== lookup
)