From 8b06a013e0b8581aeb826a8b395cf8c7886a8946 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 17 Sep 2002 07:17:25 +0000 Subject: it now generates one .c file and one .h file, and the strings are all put in an array git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2310 a1c6a512-1295-4272-9138-f99709370657 --- tools/genlang | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 7 deletions(-) (limited to 'tools/genlang') diff --git a/tools/genlang b/tools/genlang index 827ceb3949..2e3f212023 100755 --- a/tools/genlang +++ b/tools/genlang @@ -1,25 +1,51 @@ -#!/usr/bin/perl +#!/usr/bin/perl -s if(!$ARGV[0]) { print < +Usage: lang.pl [-p=] + +When running this program. .h and .c will be created in the +"current directory". is "lang" by default. MOO ; exit; } -print <$prefix.h"); +open(CFILE, ">$prefix.c"); + +print HFILE <) { if($_ =~ / *\#/) { # comment @@ -39,7 +65,9 @@ while() { $value = $set{'eng'}; } - print "#define ".$set{'id'}." $value\n"; + print HFILE " ".$set{'id'}.",\n"; + print CFILE " $value,\n"; + undef %set; } @@ -47,3 +75,19 @@ while() { } close(LANG); + + +print HFILE <