summaryrefslogtreecommitdiff
path: root/scripts/gentables
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gentables')
-rwxr-xr-xscripts/gentables47
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/gentables b/scripts/gentables
new file mode 100755
index 0000000..f7fcc89
--- /dev/null
+++ b/scripts/gentables
@@ -0,0 +1,47 @@
+
+(
+ echo "
+//autogenerated by `pwd -P`/$0
+
+genres_t genres[] = {"
+
+cat scripts/genres.txt | while read gdid id3 name
+do
+ test "$id3" = N && id3=-1
+ test "$gdid" = NULL && break
+ echo ' { "'$gdid'", '$id3', "'$name'" },'
+done
+echo '};
+'
+
+echo "lang_t languages[] = {"
+
+scripts/iso639tab.py scripts/iso_639.xml |
+ grep -v '^#' |
+ grep -v '^$' |
+ while read iso1 iso2 iso3 name
+do
+ echo ' { "'$iso2'", "'$name'" },'
+done
+echo '};
+'
+
+echo "musictypes_t musictypes[] = {"
+
+cat scripts/musictypes.txt | while read mtype
+do
+ echo ' { "'$mtype'"},'
+done
+echo '};
+'
+
+echo "sources_t sources[] = {"
+
+cat scripts/sources.txt | while read stype
+do
+ echo ' { "'$stype'"},'
+done
+echo '};'
+) >mg_tables.h
+
+