From 92cf8ca257a039a730d8c5ed92dbff318d318b40 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 21 Mar 2006 12:56:52 +0000 Subject: seems to generate correct .c and .h files from v2 files git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9163 a1c6a512-1295-4272-9138-f99709370657 --- tools/genlang2 | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/tools/genlang2 b/tools/genlang2 index 6db7d39..400b915 100755 --- a/tools/genlang2 +++ b/tools/genlang2 @@ -1,4 +1,14 @@ #!/usr/bin/perl -s +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# $Id$ +# +# Copyright (C) 2006 by Daniel Stenberg +# if(!$ARGV[0]) { print <) { @@ -150,23 +161,29 @@ while() { if($part =~ /^\//) { if($part eq "/phrase") { my $idstr = $phrase{'id'}; + my $idnum; + + if($idstr =~ /^VOICE/) { + $idnum = $voiceid++; + } + else { + $idnum = $idcount++; + } - $id{$idstr} = $idcount; - $idnum[$idcount]=$idstr; + $id{$idstr} = $idnum; + $idnum[$idnum]=$idstr; $source{$idstr}=$src; $dest{$idstr}=$dest; $voice{$idstr}=$voice; if($verbose) { - print "id: $phrase{id}\n"; + print "id: $phrase{id} ($idnum)\n"; print "source: $src\n"; print "dest: $dest\n"; print "voice: $voice\n"; } - $idcount++; - undef $src; undef $dest; undef $voice; @@ -208,7 +225,16 @@ print HFILE <