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.ai.mit.edu>, 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, see <http://www.gnu.org/licenses/>.
20 /* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
26 #include "libgettext.h"\
28 const struct _msg_ent _msg_tbl[] = {
34 # Write msgid entries in C array form.
37 s/msgid[ ]*\(".*"\)/ {\1/
39 # Append the next line
42 # Look whether second part is continuation line.
43 s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
46 # Because we assume that the input file correctly formed the line
47 # just read cannot be again be a msgid line. So it's safe to ignore
51 # We found a continuation line. But before printing insert '\'.
53 s/\(.*\)\(\n.*\)/\1\\\2/
55 # We cannot use D here.
57 # Some buggy seds do not clear the `successful substitution since last ``t'''
58 # flag on `N', so we do a `t' here to clear it.
63 # The following nice solution is by
64 # Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
66 # Increment a decimal number in pattern space.
67 # First hide trailing `9' digits.
71 # Assure at least one digit is available.
73 # Increment the last digit.
83 # Convert the hidden `9' digits to `0's.
87 s/\(.*\)\n\([0-9]*\)/\1, \2},/
99 s/0*\(.*\)/int _msg_tbl_length = \1;/p