2000-01-09 21:03:13 -06:00
|
|
|
|
#! /usr/bin/perl -s
|
|
|
|
|
#
|
|
|
|
|
# extract-macros.perl.in - Generate C file for input to xgettext
|
|
|
|
|
# Copyright (C) 1999 Laurent P<>lecq
|
|
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License as
|
|
|
|
|
# published by the Free Software Foundation; either version 2 of
|
|
|
|
|
# the License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
#
|
|
|
|
|
# Author: Laurent P<>lecq
|
|
|
|
|
# Address: 71 rue de Bagnolet
|
|
|
|
|
# F-75020 Paris (France)
|
|
|
|
|
|
|
|
|
|
# Begin variables set by configure
|
|
|
|
|
|
|
|
|
|
$package_name="@PACKAGE@";
|
|
|
|
|
$cpp="@CPP@";
|
|
|
|
|
|
|
|
|
|
# End variables set by configure
|
|
|
|
|
|
|
|
|
|
sub usage {
|
|
|
|
|
my ($status)=@_;
|
|
|
|
|
print "usage:\t$0 <header-file> ...\n";
|
|
|
|
|
exit $status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
usage 1 if $#ARGV==-1;
|
|
|
|
|
usage 0 if $h;
|
|
|
|
|
|
|
|
|
|
$prefile="messages-i18n.c";
|
|
|
|
|
|
|
|
|
|
open(TMP, ">$prefile") || die "$prefile: can't open file\n";
|
|
|
|
|
|
|
|
|
|
select TMP;
|
|
|
|
|
printf "/* automatically generated by %s\n", $0;
|
|
|
|
|
printf " source files:\n";
|
|
|
|
|
foreach $file (@ARGV)
|
|
|
|
|
{
|
|
|
|
|
printf " - %s\n", $file;
|
|
|
|
|
}
|
|
|
|
|
printf "*/\n\n";
|
|
|
|
|
foreach $file (@ARGV)
|
|
|
|
|
{
|
|
|
|
|
printf "#include \"%s\"\n", $file;
|
|
|
|
|
}
|
|
|
|
|
printf "\n/* Strings for package %s */\n", $package_name;
|
|
|
|
|
printf "const char *all_strings[]={\n";
|
|
|
|
|
|
|
|
|
|
while(<>)
|
|
|
|
|
{
|
|
|
|
|
printf ("\t%s,\n", $1) if (/^#define\s+([A-Z0-9_]+)\s+_\(\"/);
|
2000-04-09 13:51:04 -05:00
|
|
|
|
printf ("\t_ %s,\n", $1) if (/^#define\s+([A-Z0-9_]+)\s+N_\(\"/);
|
2000-01-09 21:03:13 -06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf "\tNULL\n";
|
|
|
|
|
printf "};\n";
|
|
|
|
|
select STDOUT;
|
|
|
|
|
close (TMP);
|
|
|
|
|
|
|
|
|
|
system ("$cpp -DHAVE_GETTEXT $prefile");
|
|
|
|
|
unlink ($prefile);
|