merge the formfield patch from ooo-build
[ooovba.git] / sw / inc / poolfmt.awk
blob810d714dff9556919d6c171b189ca9ace9729b59
1 #*************************************************************************
2 #*
3 #* $Workfile: dbgxtor.awk
4 #*
5 #* Ersterstellung JP 05.10.95
6 #* Letzte Aenderung $Author: hr $ $Date: 2000-09-18 17:14:27 $
7 #* $Revision: 1.1.1.1 $
8 #*
9 #* $Logfile: T:/sw/inc/poolfmt.awv $
11 #* Copyright (c) 1990-1996, STAR DIVISION
13 #*************************************************************************
16 # Dieses awk-script generiert ein cxx-file, das alle PoolIds der Vorlage dumpt.
17 # wird fuer den HelpPI gebraucht.
18 # Aufruf: awk -f poolid.awk poolfmt.hxx > poolid.cxx
19 # cl poolid.cxx
20 # poolid.exe > ???.hrc
23 function Header() {
24 print "// This is an outputfile of an awk-script: $Workfile: poolfmt.awk $"
25 print "#include <solar.h> "
26 print
27 print "#include <stdio.h>"
28 print "#include <stdlib.h>"
29 print
30 print "#pragma hdrstop"
31 print
32 print "#include <iostream.hxx> "
33 print "#include \"poolfmt.hxx\""
34 print
37 function Main() {
38 print
39 print "void main( int , char *[] ) {"
40 sStr = "#define"
41 print " int nSize = (sizeof(ppPoolIds) / sizeof(PoolFmtIds)) - 1;"
42 print " for( int n = 0; n < nSize; n++ )"
43 print " printf( \"" sStr " %s\\t%8d\\n\", ppPoolIds[ n ].pStr, ppPoolIds[ n ].nId );"
44 print "}"
47 function TableHead() {
48 print
49 print "struct PoolFmtIds { int nId; const char* pStr; };"
50 print "static PoolFmtIds ppPoolIds[] = {"
53 function TableTail() {
54 print " 0, \"\" };"
55 print
58 BEGIN {
59 Header();
60 TableHead();
63 /^[ \t]*RES_/ && !index( $1, "_BEGIN" ) && !index( $1, "_END" ) && !index( $1, "_POOL_" ) {
64 sStr = $1;
65 split( $1, sStr, "," );
66 print " " sStr[1] ", \"" sStr[1] "\","
69 END {
70 TableTail();
71 Main();