1 # po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
2 # Copyright (C) 1995 Free Software Foundation, Inc.
3 # Ulrich Drepper <drepper@gnu.org>, 1995.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 /* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
27 #include "libgettext.h"\
29 const struct _msg_ent _msg_tbl[] = {
35 # Write msgid entries in C array form.
38 s/msgid[ ]*\(".*"\)/ {\1/
40 # Append the next line
43 # Look whether second part is continuation line.
44 s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
47 # Because we assume that the input file correctly formed the line
48 # just read cannot be again be a msgid line. So it's safe to ignore
52 # We found a continuation line. But before printing insert '\'.
54 s/\(.*\)\(\n.*\)/\1\\\2/
56 # We cannot use D here.
58 # Some buggy seds do not clear the `successful substitution since last ``t'''
59 # flag on `N', so we do a `t' here to clear it.
64 # The following nice solution is by
65 # Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
67 # Increment a decimal number in pattern space.
68 # First hide trailing `9' digits.
72 # Assure at least one digit is available.
74 # Increment the last digit.
84 # Convert the hidden `9' digits to `0's.
88 s/\(.*\)\n\([0-9]*\)/\1, \2},/
100 s/0*\(.*\)/int _msg_tbl_length = \1;/p