regen pidl all: rm epan/dissectors/pidl/*-stamp; pushd epan/dissectors/pidl/ && make...
[wireshark-sm.git] / fix / hfDecl.xsl
blobae50d80bcd936061430c82f1e6f8b41f081501d4
1 <!--
2 -->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
5 <xsl:output method="text" encoding="UTF-8"/>
7 <xsl:template match="text()"/>
9 <xsl:template match="fields">
10 static const fix_field fix_fields[] = {
11 <xsl:for-each select="field">
12 <xsl:sort select="@number" data-type="number"/>
13 <xsl:choose>
14 <xsl:when test="count( value ) != 0">
15 <xsl:variable name="val_type" >
16 <xsl:choose>
17 <xsl:when test="@type='INT'">0</xsl:when>
18 <xsl:when test="@type='STRING'">1</xsl:when>
19 <xsl:otherwise>2</xsl:otherwise>
20 </xsl:choose>
21 </xsl:variable>
22 { <xsl:value-of select="@number"/>, <xsl:copy-of select="$val_type" />, <xsl:value-of select="@name"/>_val },</xsl:when>
23 <xsl:otherwise>
24 { <xsl:value-of select="@number"/>, 0, NULL }, /* <xsl:value-of select="@name"/> */</xsl:otherwise>
25 </xsl:choose>
26 </xsl:for-each>
29 <xsl:text>static int fix_hf[</xsl:text>
30 <xsl:value-of select="count( field )"/>
31 <xsl:text>];</xsl:text>
32 </xsl:template>
33 </xsl:stylesheet>