bump product version to 5.0.4.1
[LibreOffice.git] / sc / util / number-defines-consecutively.awk
blob6297dcdb2a359650442290e140b21f4865fa5b6f
1 #!/usr/bin/awk -f
3 # -*- Mode: awk; tab-width: 4; indent-tabs-mode: t -*-
5 # This file is part of the LibreOffice project.
7 # This Source Code Form is subject to the terms of the Mozilla Public
8 # License, v. 2.0. If a copy of the MPL was not distributed with this
9 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 # Consecutively number a series of defines, for example sc/inc/globstr.hrc
13 # WARNING: this does not expect other defines in between and would mess around
14 # with them.
16 BEGIN {
17 id = 0;
18 lastline = ""
22 if ($1 ~ /#define/ && lastline !~ /#ifndef/)
24 n = split( $0, a, / +/, s);
25 if (dup[a[3]])
27 dupmsg = " // XXX was duplicate " a[3] " of " dup[a[3]];
29 else
31 dup[a[3]] = a[2];
32 dupmsg = "";
34 a[3] = ++id;
35 lastline = s[0];
36 for (i=1; i<=n; ++i)
38 lastline = lastline a[i] s[i];
40 lastline = lastline dupmsg;
42 else
44 lastline = $0;
46 print lastline;
49 # vim:set shiftwidth=4 softtabstop=4 expandtab: