1
## ntop xml output generator -- tools
3
# Written by and copyright (c) 2002, Burton M. Strauss III
5
# Distributed as part of ntop, http://www.ntop.org
7
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
9
# This program is free software; you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 2 of the License, or
12
# (at your option) any later version.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
19
# You should have received a copy of the GNU General Public License
20
# along with this program; if not, write to the Free Software Foundation,
21
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
25
# This tool is part of the ntop xml output system, but it is in fact
26
# not normally executed by persons compiling ntop.
28
# It is designed for the developers of ntop to create various .inc files
29
# used by xmldumpPlugin.c. It should be run after any changes to globals.h or
32
# Note that it IS perfectly safe to run, since you should NEVER be editing
33
# the generated .inc files by hand.
35
# Usage: awk -f xmldump.awk xxx.h
37
# This script is designed to extract structured comments from ntop .h files
38
# to create c code in the .inc files which are the xml (gdome) statements
39
# for xmldumpPlugin.c to build the DOM structure.
41
# Beware - between this routine and the convenience functions in xmldumpPlugin.c,
42
# A LOT of complexity is hidden.
44
# The "structured comment language":
46
#/*XMLNOTE ...whatever... */
47
# --Is a comment, but one that we are indicating is related to the xml stuff.
49
#/*XMLSECTIONBEGIN filename parent prefix */
50
# --Causes new file to be created, and to start creating xml statements under
51
# the node [el]parent, pulling data from prefix.whatever
53
# So the typical /*XMLSECTIONBEGIN xmlmyglobals.inc Globals myGlobals */
54
# starts writing to xmlmyglobals.inc, using elGlobals as the base node and
55
# prefixing variables by myGlobals.
57
#/*XMLSECTIONEND [name] */
58
# --Ends echo to section...
60
#/*XMLPARENT parent */
61
# --Causes new parent to be used... keeping name and prefix.
63
#/*XMLPREFIX prefix */
64
# --Causes new prefix to be used... keeping name and parent.
66
# The processing statement is:
68
#/*XML type[:format] item[:itemname] childof[:result] "description" */
75
# nc:[fmt] numeric constant (e.g. #define) ... NO PREFIX!
77
# sc string constant (e.g. #define) ... NO PREFIX!
78
# si string index (special form of string)
80
# * special (inline) code
82
#/*XMLEXISTS nodename ... */
83
# --Tells script that nodename exists ... loads it into nodes[]
85
#/*XMLFOR var initial test [operand] */
88
# XMLFOR i 0 "a[i] != NULL" -> for (i=0; a[i] != NULL; i++)
89
# XMLFOR i 0 1 -> for (i=0; i<1; i++)
90
# XMLFOR i 0 1 <= -> for (i=0; i<=1; i++)
93
# --creates closing } for XMLFOR
98
# -- becomes if (test) { ...
102
# ... source ... with $x variables substituted ...
106
function insert_nodes(value, tag) {
107
if (debug != "") printf(" /*XMLNOTE insert_node(%s)=%s\n", value, tag)
113
function process_parent() {
114
if (parent == "root") {
115
parentnodename=parent
116
} else if (parent == "parent") {
117
parentnodename=parent
119
parentnodename="el" toupper(substr(parent, 1, 1)) substr(parent, 2)
121
if (parent in nodes) {
123
if (debug != "") printf(" /*XMLNOTE Generating node %s, child of root\n", parent)
124
printf("/* *via XMLPARENT********************************Assume root* */\n" \
125
"%s%s = newxmlna(GDOME_ELEMENT_NODE, root, \"%s\");\n\n",
129
insert_nodes(parent, "XMLPARENT")
133
function process_prefix() {
134
if (substr(prefix, length(prefix)-1) == "->") {
136
stripedprefix=substr(prefix, 1, length(prefix)-2)
137
} else if (substr(prefix, length(prefix)) == ".") {
139
stripedprefix=substr(prefix, 1, length(prefix)-1)
140
sub(/\[i.*\]/, "", stripedprefix);
142
if (prefix != "myGlobals") {
152
# export debug=anything to turn on debug
153
debug=ENVIRON["XMLDUMPDEBUG"]
155
# Start off dumping to the bit bucket.
156
outputname="/dev/null"
158
print "xmldump.awk running..."
163
nodes["root"] = "Default"
164
nodes["parent"] = "Default"
166
workNodePrefix="elWork"
169
# Preset the stuff we "know"...
171
type_macroname_conversion["b"] = "newxml_simplenoyes"
172
type_macroname_conversion["h"] = "newxml_simplehex"
173
type_macroname_conversion["e"] = "newxml_empty"
174
type_macroname_conversion["n"] = "newxml_simplenumeric"
175
type_macroname_conversion["nc"] = "newxml_namednumeric"
176
type_macroname_conversion["s"] = "newxml_simplestring"
177
type_macroname_conversion["sc"] = "newxml_namedstring"
178
type_macroname_conversion["si"] = "newxml_simplestringindex"
179
type_macroname_conversion["*"] = "special-inline-code"
180
type_macroname_conversion["SPECIAL1"] = "special-output-coding"
183
# Special conversions...
185
type_macroname_conversion["tcp_seq"] = "newxml_namednumeric"
186
macroformat["tcp_seq"] = "u"
188
# Skip the (item, value) pair on the call, also
189
# Force an empty :result to itemname
190
type_nonvalue_node["e"] = "yes"
192
# Don't prepend the "prefix" from XMLSECTIONBEGIN / XMLPREFIX on these
193
# Generate <name constantname=value> instead of the <item= value= >
194
type_constant_item["nc"] = "yes"
195
type_constant_item["sc"] = "yes"
197
# These append and (index, value) set to the parameters (value is the index to append)
198
##type_appendindex["hosttraffic"] ="j"
199
##type_appendindex["si"] ="i"
202
# Load a list of stuff defined in xmldumpPlugin.c
204
system("grep '^ *#define *newxml_' xmldumpPlugin.c >/tmp/xmldump1")
205
while (getline < "/tmp/xmldump1" > 0) {
207
macro=substr($2, 1, i-1)
208
gsub(/newxml_/, "", macro)
209
type_macroname_conversion[macro] = "newxml_" macro
211
system("grep '^GdomeElement \\* newxml_' xmldumpPlugin.c > /tmp/xmldump2")
212
while (getline < "/tmp/xmldump2" > 0) {
214
functionname=substr($3, 1, i-1)
215
gsub(/newxml_/, "", functionname)
216
type_macroname_conversion[functionname] = "newxml_" functionname
219
system("rm -f /tmp/xmldump[12]")
225
# Count input lines...
231
#/*XMLNOTE ... whatever ... */
232
# This is just a note to ourselves ... ignore it...
233
if (debug != "") print " " $0
237
$1 == "/*XMLSECTIONBEGIN" {
238
# Handle (close) prior section...
239
if ( (outputname != "") && (outputname != "/dev/null") ) {
240
if (debug != "") printf(" /*XMLNOTE Closing %s */\n", outputname)
241
print "" >>outputname
248
if (outputname in sections) {
249
if (debug != "") print " /*XMLNOTE Resuming " outputname " */"
252
if (debug != "") print " /*XMLNOTE Begining " outputname " */"
253
sections[outputname]="Yes"
254
printf("/* Created by xmldump.awk\n" \
256
" * part of and licensed the same as ntop, http://www.ntop.org\n" \
258
" * WARNING: Changes made here will be lost the next time this\n" \
259
" * file is recreated, which can happen automatically during\n" \
260
" * a 'make'. Y'all been warned, now!\n" \
262
" */\n\n\n") >outputname
271
if (sectionhead == "y") {
272
if (stripedprefix != "myGlobals") {
273
printf(" if (%s == NULL) { return NULL; };\n", stripedprefix) >>outputname
275
printf(" if (%s == NULL) { return NULL; };\n\n\n", parentnodename) >>outputname
281
$1 == "/*XMLPARENT" {
288
$1 == "/*XMLPREFIX" {
294
$1 == "/*XMLSECTIONEND" {
295
if (outputname != "") {
296
if (debug != "") print " /*XMLNODE Suspending " outputname " */"
297
print "" >>outputname
300
outputname = "/dev/null"
304
$1 == "/*XMLEXISTS" {
305
for (i=2; i<NF; i++) {
306
if ($i == "*/") { break }
307
if ( ($i != "") && ($i != "root") && ($1 != "parent") ) {
308
if (debug != "") print " /*XMLNOTE XMLEXISTS - marking node " $i " */"
309
insert_nodes($i, "XMLEXISTS")
316
$1 == "/*XMLINLINE" {
318
inlinecode_start[inlinename] = inlineline
319
while (getline > 0) {
320
if ($1 == "XML*/") { break }
321
inlinecode[inlineline++] = $0
323
inlinecode_end[inlinename] = inlineline
332
if (substr($4, 1, 1) == "\"") {
334
for (i=5; i<NF; i++) {
335
compare = compare " " $i
337
gsub(/\"/, "", compare)
338
} else if ($5 == "*/") {
341
compare = $2 " " $5 " " $4
346
printf("%s{ int %s;\n%s for (%s; %s; %s) {\n", indent, var, indent, init, compare, increment) >>outputname
351
(($1 == "/*XMLROF") || ($1 == "/*XMLROF*/")) {
352
indent = substr(indent, 1, length(indent)-1)
353
printf("%s} }\n\n", indent) >>outputname
359
for (i=3; i<=NF; i++) {
367
printf("%sif (%s) {\n", indent, test) >>outputname
372
(($1 == "/*XMLELSE") || ($1 == "/*XMLELSE*/")) {
373
printf("%s} else {\n\n", indent) >>outputname
377
(($1 == "/*XMLFI") || ($1 == "/*XMLFI*/")) {
378
indent = substr(indent, 1, length(indent)-1)
379
printf("%s}\n\n", indent) >>outputname
383
substr($1, 1, 3) == "#if" {
384
print "\n" $0 >>outputname
388
substr($1, 1, 5) == "#else" {
389
print $0 >>outputname
393
substr($1, 1, 5) == "#elif" {
394
print $0 >>outputname
398
substr($1, 1, 6) == "#endif" {
399
print $0 "\n" >>outputname
404
#/*XML type[:format] item[!]itemname childof[:result] "description" */
410
if ( (NF < 5) && ($2 != "x") && ($2 != "*") ) {
411
printf("\n\n ERROR -- missing fields on following line:\n%5d. %s\n\n", lines, $0)
415
if ((i=index($2, ":")) > 0) {
416
typeflag = substr($2, 1, i-1)
417
format = substr($2, i+1)
423
if ((i=index($3, "!")) > 0) {
424
item = substr($3, 1, i-1)
425
itemname= substr($3, i+1)
431
if ((i=index($4, ":")) > 0) {
432
childof = substr($4, 1, i-1)
433
result = substr($4, i+1)
440
for (i=6; i<NF; i++) {
442
description = description " " $i
447
f1 = typeflag (format == "" ? "" : ":") format
448
f2 = item (item == itemname ? "" : "!" itemname)
449
f3 = childof (result == "" ? "" : ":") result
450
processedline = sprintf("/*XML %-15s %-20s %-15s %s */",
455
print indent processedline >>outputname
456
if (debug > "1") { printf(" /*XMLNOTE input line is '%s' */\n", $0)
457
printf(" /*XMLNOTE processed as '%s' */\n", processedline)
458
printf("\n /*XMLNOTE RAW values: */\n")
459
printf(" /*XMLNOTE childof.........'%s' */\n", childof)
460
printf(" /*XMLNOTE description.....'%s' */\n", description)
461
printf(" /*XMLNOTE format..........'%s' */\n", format)
462
printf(" /*XMLNOTE item............'%s' */\n", item)
463
printf(" /*XMLNOTE itemname........'%s' */\n", itemname)
464
printf(" /*XMLNOTE result..........'%s' */\n", result)
465
printf(" /*XMLNOTE typeflag........'%s' */\n", typeflag)
468
# Errors and other reasons to ignore this...
469
if (typeflag == "x") {
470
if (debug != "") printf(" /*XMLNOTE Ignored: %s */\n", item)
473
if (result == "root") {
474
if (debug != "") printf(" /*XMLNOTE ERROR resetting root node */\n")
476
} else if (result == "parent") {
477
if (debug != "") printf(" /*XMLNOTE ERROR resetting parent node */\n")
481
# Convenience conversions...
482
if (typeflag == "char*") {
486
# Cleanup, Tests and priority items...
488
if (typeflag == "*") {
490
while (substr(typeflag, 1, 1) == "*") {
491
typeprefix=typeprefix "* "
492
typeflag = substr(typeflag, 2)
494
if (substr(typeflag, 1, 1) == "&") {
495
typeprefix=typeprefix "&"
496
typeflag = substr(typeflag, 2)
499
if (debug > "1") { printf("\n /*XMLNOTE PROCESSED values: */\n")
500
printf(" /*XMLNOTE typeflag........'%s' */\n", typeflag)
501
printf(" /*XMLNOTE typeprefix......'%s' */\n", typeprefix)
505
if (debug > "1") { printf(" /*XMLNOTE item............'%s' */\n", item) }
507
if (childof == ".") {
509
if (debug > "1") { printf(" /*XMLNOTE childof.........'%s' */\n", childof) }
511
if (description == "*/") {
513
if (debug > "1") { printf(" /*XMLNOTE description.....'%s' */\n", description) }
518
# What about the "item"? Just to clarify...
519
# item is the way the user named it (e.g. xyz) -- we don't use that past here
520
# itemname is how to refer to it in xml (xyz)
521
# Setting those is handled above, like all the other field splits
522
# itemref is how to refer to it in c (myGlobals.xyz)
523
# fieldname is the stripped version of itemname
525
# Cleanup itemname, stripping indexes, pointers, etc.
526
while ((i=index(itemname, ".")) > 0) {
527
itemname=substr(itemname, i+1)
529
while ((i=index(itemname, "->")) > 0) {
530
itemname=substr(itemname, i+2)
532
if ((i=index(itemname, "[")) > 0) {
533
itemname=substr(itemname, 1, i-1)
535
if (debug > "1") { printf(" /*XMLNOTE itemname........'%s' (xml) */\n", itemname) }
538
# Cleanup fieldname, stripping indexes, pointers, etc.
539
while ((i=index(fieldname, ".")) > 0) {
540
fieldname=substr(fieldname, i+1)
542
while ((i=index(fieldname, "->")) > 0) {
543
fieldname=substr(fieldname, i+2)
545
while ((i=index(fieldname, "&")) > 0) {
546
fieldname=substr(fieldname, i+1)
548
if ((i=index(fieldname, "[")) > 0) {
549
fieldname=substr(fieldname, 1, i-1)
551
if (debug > "1") { printf(" /*XMLNOTE fieldname.......'%s' (stripped) */\n", fieldname) }
554
if (typeflag in type_constant_item) {
557
if ( (substr(item, 1, 1) == ".") ||
558
(substr(item, 1, 2) == "->") ) {
560
} else if (substr(item, 1, 1) == "&") {
562
itemref= "&" prefix connect item
563
# } else if (prefix == "myGlobals") {
564
# itemref= "&" prefix connect item
566
itemref= prefix connect item
569
if (debug > "1") { printf(" /*XMLNOTE itemref.........'%s' (c) */\n", itemref) }
571
if (childof == "root") {
573
} else if (childof == "parent") {
574
childnodename="parent"
575
} else if (childof != "") {
576
childnodename="el" toupper(substr(childof, 1, 1)) substr(childof, 2)
578
if (debug > "1") { printf(" /*XMLNOTE childnodename...'%s' */\n", childnodename) }
581
if (substr(childnodename, 1, length(workNodePrefix)) != workNodePrefix) {
582
# Child, not elWorkxxx, test if the child node exists...
583
if (childnodename in nodes) {
585
# no result and childof doesn't exist ... force it to be set...
589
if (debug > "1") { printf(" /*XMLNOTE makechildnode...'%s' */\n", makechildnode) }
591
if ( (typeflag in type_nonvalue_node) && (result == "") ) {
593
if (debug > "1") { printf(" /*XMLNOTE result..........'%s' - FORCED (empty) */\n", result) }
596
result="el" toupper(substr(result, 1, 1)) substr(result, 2)
597
if (debug > "1") { printf(" /*XMLNOTE result..........'%s' */\n", result) }
600
if ((i=index(item, "[")) > 0) {
602
indexname=substr(item, i+1, j-i-1)
606
if (debug > "1") { printf(" /*XMLNOTE indexname.......'%s' */\n", indexname) }
608
if (typeflag in type_macroname_conversion) {
609
macro=type_macroname_conversion[typeflag]
610
if (typeflag in macroappend) {
611
macroappendvalue=macroappend[typeflag]
615
if (typeflag in macroformat) {
616
format=macroformat[typeflag]
618
} else if (typeflag in inlinecode_start) {
620
printf("\n\n ERROR -- type flag '%s' is unknown on following line:\n%5d. %s\n\n",
627
if ( ( (typeflag == "n") || (typeflag == "nc") ) && (format == "") ) {
629
if (debug > "1") printf(" /*XMLNOTE format set to %s */\n", format)
631
if (debug > "1") { printf(" /*XMLNOTE macro...........'%s' */\n", macro)
632
printf(" /*XMLNOTE ..appendvalue...'%s' */\n", macroappendvalue)
633
printf(" /*XMLNOTE format..........'%s' */\n", format) }
635
# To set the result AND use simplenumeric we can't just use the xmldumpPlugin.c macro...
636
# Since this is dependent on the xmldumpPlugin.c macros, we hardcode their names here...
638
if ( (macro=="newxml_simplenumeric") && (result != "") ) {
639
if (debug != "") printf(" /*XMLNOTE numeric+result - macroname was %s, set to newxml_simplestring */\n", macro)
640
macro="newxml_simplestring"
641
buftext=sprintf("if (snprintf(buf, sizeof(buf), \"%%%s\", %s) < 0) BufferTooShort();",
646
} else if ( (macro=="newxml_namednumeric") && (result != "") ) {
647
if (debug != "") printf(" /*XMLNOTE numeric+result - macroname was %s, set to newxml_simplestring */\n", macro)
650
if (debug > "1") { printf(" /*XMLNOTE macro...........'%s' */\n", macro)
651
printf(" /*XMLNOTE itemref.........'%s' */\n", itemref)
652
printf(" /*XMLNOTE buftext.........'%s' */\n", buftext)
653
printf(" /*XMLNOTE typeflag........'%s' */\n", typeflag)
654
printf(" /*XMLNOTE format..........'%s' */\n", format) }
658
# 1. Create the child node if necessary...
659
if (makechildnode == "Y") {
660
if (debug != "") printf(" /*XMLNOTE (auto) generating node %s, child of %s */\n",
661
childnodename, parentnodename)
662
printf("%s/* *****************************************Auto create node** */\n" \
663
"%s%s = newxmlna(GDOME_ELEMENT_NODE, %s, \"%s\");\n",
668
childof) >>outputname
669
insert_nodes(childnodename, "ChildAutoCreate")
672
# 2. Handle inline code...
673
# Just copy all lines until XML*/ found
674
if (typeflag == "*") {
675
if (debug != "") printf(" /*XMLNOTE Processing (inline) %s, %s */\n", item, description)
676
printf("\n%s/* %scopied from %s at line %d */\n",
678
description == "\"\"" ? "" : description " ",
681
while (getline > 0) {
682
if ($1 == "XML*/") { break }
683
print indent $0 >>outputname
685
printf("%s/* end copy from %s */\n\n", indent, ARGV[1]) >>outputname
689
# 2a. Handle XMLINLINE field
690
if (typeflag in inlinecode_start) {
691
if (debug != "") printf(" /*XMLNOTE Processing (xmlinline) %s, %s */\n", item, description)
692
printf("\n%s/*i %sgenerated from %s at line %d */\n",
694
description == "\"\"" ? "" : description " ",
697
for (i=inlinecode_start[typeflag]; i<inlinecode_end[typeflag]; i++) {
698
otext = inlinecode[i]
701
f=substr(otext, j+1, 1)
704
stext = stripedprefix connect
705
} else if (f == "X") {
706
if (description != "\"\"") {
707
stext = ",\n" indent "/*i*/ \"description\", " description " "
711
} else if (f == "2") {
713
} else if (f == "3") {
715
} else if (f == "4") {
716
stext = childnodename
717
} else if (f == "5") {
720
otext = substr(otext, 1, j-1) stext substr(otext, j+2)
723
if (substr(otext, 1, 1) == "#") {
724
print otext >>outputname
726
print indent "/*i*/ " otext >>outputname
733
# OUTPUT OUTPUT OUTPUT
736
# 3. Let's output the code...
738
if (typeflag == "SPECIAL1") {
739
# Special case for simplenumeric with result
740
if (debug != "") printf(" /*XMLNOTE SPECIAL1 */\n")
741
printf("%sif (snprintf(buf, sizeof(buf), \"%%%s\", %s) < 0) BufferTooShort();\n",
742
indent, format, itemref) >> outputname
743
printf("%s%s = newxml(GDOME_ELEMENT_NODE, %s, \"%s\", \n" \
744
"%s \"%s\", buf,\n" \
745
"%s \"description\", %s);\n\n\n",
746
indent, result, childnodename, itemname,
748
indent, description) >>outputname
749
insert_nodes(result, "special1set")
755
# NULL checks on pointers...
756
if ( (typeflag != "e") && (typeprefix ~ /\*/) ) {
758
i=index(itemrefroot, "[")
760
itemrefroot=substr(itemrefroot, 1, i-1)
762
if (debug > "1") { printf(" /*XMLNOTE itemrefroot.....'%s' */\n", itemrefroot) }
764
workprefix=typeprefix
767
while (workprefix != "") {
768
if (debug > "1") { printf(" /*XMLNOTE workprefix......'%s' */\n", workprefix)
769
printf(" /*XMLNOTE testprefix......'%s' */\n", testprefix) }
770
printf("%sif (%s%s != NULL) {\n", indent, testprefix, itemrefroot) >>outputname
771
workprefix=substr(workprefix, 3)
772
testprefix=testprefix "* "
774
if (debug > "1") { printf(" /*XMLNOTE indent..........'%s' */\n", indent) }
777
# Normal case, build it up, piece by piece... (Note no \n 's in most pieces)
778
# If there is a sprintf to buf...
780
printf("%s%s\n", indent, buftext) >>outputname
782
# Start the macro/function... handling it if there is a result
784
printf("%s", indent) >>outputname
787
printf("%s = ", result) >>outputname
791
macro, (gdomenode != "" ? gdomenode ", " : ""), childnodename) >>outputname
792
printf("%s %s%s%s,\n",
794
fieldname == "nodename" ? "" : "\"",
796
fieldname == "nodename" ? "" : "\"") >>outputname
798
# Skip the "value" piece for non-valued nodes
799
if (typeflag in type_nonvalue_node) {
800
if (debug != "") { printf(" /*XMLNOTE typeflag '%s' in type_nonvalue_node */\n", typeflag) }
802
if ( (typeprefix == "") || (typeprefix == "&") ) {
803
workprefix = typeprefix
805
workprefix = substr(typeprefix, 3)
807
if (debug > "1") { printf(" /*XMLNOTE workprefix......'%s' */\n", workprefix) }
808
printf("%s %s%s%s%s,\n",
811
workprefix == "" ? "" : "(",
813
workprefix == "" ? "" : ")" ) >>outputname
818
indent, description) >>outputname
820
# Post description parameters (constants, formats, index)
821
if (type_macroname_conversion[typeflag] == "newxml_namedstring") {
822
printf(",\n%s \"%s\"",
823
indent, itemname) >>outputname
824
} else if (type_macroname_conversion[typeflag] == "newxml_namednumeric") {
825
printf(",\n%s \"%%%s\"",
826
indent, format != "" ? format : "d") >>outputname
827
printf(",\n%s \"%s\"",
828
indent, itemname) >>outputname
829
} else if (format != "" ) {
830
printf(",\n%s \"%%%s\"",
831
indent, format) >>outputname
832
##} else if (typeflag in type_appendindex) {
833
## printf(",\n%s %s",
834
## indent, type_appendindex[typeflag]) >>outputname
838
printf(");\n\n") >>outputname
840
# NULL checks on pointers...
841
if ( (typeflag != "e") && (typeprefix ~ /\*/) ) {
842
workprefix=typeprefix
843
while (workprefix != "") {
844
indent=substr(indent, 1, length(indent) - 2)
845
workprefix=substr(workprefix, 3)
846
printf("%s}\n", indent) >>outputname
851
insert_nodes(result, "set")
859
if (outputname != "") {
860
print "" >>outputname
864
printf("/*XMLNOTE recap\n")
866
printf(" * %-30s %s\n", i, nodes[i])
870
printf("/*XMLNOTE type_macroname_conversion\n")
871
for (i in type_macroname_conversion) {
872
printf(" * %-30s %s\n", i, type_macroname_conversion[i])
876
printf("/*XMLNOTE inline\n")
877
for (i in inlinecode_start) {
878
printf(" * %-30s\n", i)
879
for (j=inlinecode_start[i]; j<inlinecode_end[i]; j++) {
880
printf(" * %3d %s\n", j-inlinecode_start[i], inlinecode[j])
886
print "xmldump.awk finished!"