2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 # This awk-script generates a cxx-file, that dumps all PoolIDs of the template.
19 # It is needed for HelpPI.
20 # Usage: awk -f poolid.awk poolfmt.hxx > poolid.cxx
22 # poolid.exe > ???.hrc
26 print "// This is an outputfile of an awk-script: $Workfile: poolfmt.awk $"
27 print "#include <solar.h> "
29 print "#include <stdio.h>"
30 print "#include <stdlib.h>"
32 print "#pragma hdrstop"
34 print "#include <iostream.hxx> "
35 print "#include \"poolfmt.hxx\""
41 print "void main( int , char *[] ) {"
43 print " int nSize = (sizeof(ppPoolIds) / sizeof(PoolFormatIds)) - 1;"
44 print " for( int n = 0; n < nSize; n++ )"
45 print " printf( \"" sStr
" %s\\t%8d\\n\", ppPoolIds[ n ].pStr, ppPoolIds[ n ].nId );"
49 function TableHead
() {
51 print "struct PoolFormatIds { int nId; const char* pStr; };"
52 print "static PoolFormatIds ppPoolIds[] = {"
55 function TableTail
() {
65 /^
[ \t]*RES_
/ && !
index( $
1, "_BEGIN" ) && !
index( $
1, "_END" ) && !
index( $
1, "_POOL_" ) {
67 split( $
1, sStr
, "," );
68 print " " sStr
[1] ", \"" sStr
[1] "\","