repo.or.cz
/
xcsoar.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Android release v6.7_preview1
[xcsoar.git]
/
tools
/
GenerateAndroidResources.pl
blob
b4038a48010ceb7c520269dd2bdf63884213a999
1
#!/usr/bin/perl -w
2
3
use
strict
;
4
5
print
<<EOT;
6
static const struct {
7
unsigned id;
8
const char *name;
9
} DrawableNames[] = {
10
EOT
11
12
while
(<>) {
13
# merge adjacent strings
14
while
(
s/"([^"]*)"\s+"([^"]*)"\s*$/"$1$2"/
) {}
15
16
print qq
| {
$1
,
\"
$2
\"
},
\n
|
17
if
/^\s*(\d+)\s+BITMAP\s+DISCARDABLE\s+"(?:.*\/
)
?
([
\w
]+)
\
.
png
"\s*$/;
18
}
19
20
print <<EOT;
21
{ 0, NULL }
22
};
23
EOT