aboutsummaryrefslogtreecommitdiffstats
path: root/docbook
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-11-23 18:16:04 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-11-23 18:16:04 +0000
commit48cced98a6b80f773aa888681f4eeb06855fb6ff (patch)
tree6476a3bd3c8e4ca3e6b42dc0d8696af3e385b7b0 /docbook
parent6aa7d26c2c01f44d5b5420daebaa29499b435676 (diff)
Fixed some indents in program listings.
svn path=/trunk/; revision=26830
Diffstat (limited to 'docbook')
-rw-r--r--docbook/wsdg_src/WSDG_chapter_dissection.xml16
1 files changed, 8 insertions, 8 deletions
diff --git a/docbook/wsdg_src/WSDG_chapter_dissection.xml b/docbook/wsdg_src/WSDG_chapter_dissection.xml
index 3637e2d0e2..41f98d0f29 100644
--- a/docbook/wsdg_src/WSDG_chapter_dissection.xml
+++ b/docbook/wsdg_src/WSDG_chapter_dissection.xml
@@ -309,7 +309,7 @@ static gint *ett[] = {
<example><title>Registering data structures.</title>
<programlisting>
<![CDATA[proto_register_field_array(proto_foo, hf, array_length(hf));
- proto_register_subtree_array(ett, array_length(ett));]]>
+proto_register_subtree_array(ett, array_length(ett));]]>
</programlisting></example>
<para>
The variables hf_foo_pdu_type and ett_foo also need to be declared
@@ -317,18 +317,16 @@ static gint *ett[] = {
</para>
<example><title>Dissector data structure globals.</title>
<programlisting>
- <![CDATA[
-static int hf_foo_pdu_type = -1;
+<![CDATA[static int hf_foo_pdu_type = -1;
-static gint ett_foo = -1;
-]]>
+static gint ett_foo = -1;]]>
</programlisting></example>
<para>
Now we can enhance the protocol display with some detail.
</para>
<example><title>Dissector starting to dissect the packets.</title>
<programlisting>
-<![CDATA[if (tree) { /* we are being asked for details */
+<![CDATA[ if (tree) { /* we are being asked for details */
proto_item *ti = NULL;
proto_tree *foo_tree = NULL;
@@ -453,7 +451,7 @@ static int hf_foo_initialip = -1;
</para>
<example><title>Adding Names to the protocol.</title>
<programlisting>
-<![CDATA[{ &hf_foo_pdu_type,
+<![CDATA[ { &hf_foo_pdu_type,
{ "FOO PDU Type", "foo.type",
FT_UINT8, BASE_DEC,
VALS(packettypenames), 0x0,
@@ -547,7 +545,9 @@ dissect_foo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str(packet_type, packettypenames, "Unknown (0x%02x)"));
foo_tree = proto_item_add_subtree(ti, ett_foo);
proto_tree_add_item(foo_tree, hf_foo_pdu_type, tvb, offset, 1, FALSE);
- offset += 1;]]>
+ offset += 1;
+ }
+}]]>
</programlisting></example>
<para>
So here, after grabbing the value of the first 8 bits, we use it with one of the