summaryrefslogtreecommitdiffstats
path: root/lib/skin_parser
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-09-11 01:50:06 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-09-11 01:50:06 +0000
commit3b9ffd28da4d2af023e6a77ab1d6ee683f90ef6b (patch)
treed779dd815acee6218e59e96329916114dcdf9ecd /lib/skin_parser
parent86c543216f13c1171eefd6dd8116855a7fa9c4bd (diff)
downloadrockbox-3b9ffd28da4d2af023e6a77ab1d6ee683f90ef6b.tar.gz
rockbox-3b9ffd28da4d2af023e6a77ab1d6ee683f90ef6b.tar.bz2
rockbox-3b9ffd28da4d2af023e6a77ab1d6ee683f90ef6b.zip
New tag %ss() which lets you get a substring of another tag.
%ss(start, length, tag) - i.e %ss(0,1,%TL) will get the first letter of the current lines text. use - for the length to get the rest of the tag (e.g %ss(1,-,%TL) will get everything after the first letter). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30500 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'lib/skin_parser')
-rw-r--r--lib/skin_parser/tag_table.c3
-rw-r--r--lib/skin_parser/tag_table.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/skin_parser/tag_table.c b/lib/skin_parser/tag_table.c
index 849e1d92dd..b93aa28c32 100644
--- a/lib/skin_parser/tag_table.c
+++ b/lib/skin_parser/tag_table.c
@@ -236,7 +236,8 @@ static const struct tag_info legal_tags[] =
{ SKIN_TOKEN_VAR_SET, "vs", "SSI|I", SKIN_REFRESH_STATIC },
{ SKIN_TOKEN_VAR_GETVAL, "vg", "S", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_VAR_TIMEOUT, "vl", "S|D", SKIN_REFRESH_DYNAMIC },
-
+
+ { SKIN_TOKEN_SUBSTRING, "ss", "IiT", SKIN_REFRESH_DYNAMIC },
{ SKIN_TOKEN_UNKNOWN, "" , "", 0 }
/* Keep this here to mark the end of the table */
};
diff --git a/lib/skin_parser/tag_table.h b/lib/skin_parser/tag_table.h
index 5a93e36866..82ee4757be 100644
--- a/lib/skin_parser/tag_table.h
+++ b/lib/skin_parser/tag_table.h
@@ -279,6 +279,8 @@ enum skin_token_type {
SKIN_TOKEN_VAR_SET,
SKIN_TOKEN_VAR_GETVAL,
SKIN_TOKEN_VAR_TIMEOUT,
+
+ SKIN_TOKEN_SUBSTRING,
};
/*