summaryrefslogtreecommitdiffstats
path: root/fix/Values.xsl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /fix/Values.xsl
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fix/Values.xsl')
-rw-r--r--fix/Values.xsl66
1 files changed, 66 insertions, 0 deletions
diff --git a/fix/Values.xsl b/fix/Values.xsl
new file mode 100644
index 0000000..106eb68
--- /dev/null
+++ b/fix/Values.xsl
@@ -0,0 +1,66 @@
+<!--
+Syntax: xsltproc Values.xsl FIX44.xml
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="text" encoding="UTF-8"/>
+
+ <xsl:template match="text()"/>
+ <xsl:template match="/">/* DO NOT EDIT
+ * This file is autogenerated
+ * Look fix/README for more information how to generate this file
+ *
+ */
+
+typedef struct _fix_field {
+ int tag; /* FIX tag */
+ int hf_id;
+ int type; /* */
+ const void *table;
+} fix_field;
+
+<xsl:apply-templates/>
+
+</xsl:template>
+
+<!--
+translate(@description,$uppercase,$smallcase)
+-->
+
+<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
+<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
+
+<xsl:template match="fix/fields">
+<xsl:for-each select="field[value]">
+ <xsl:variable name="val_type" >
+ <xsl:choose>
+ <xsl:when test="@type='STRING'"> string_string </xsl:when>
+ <xsl:when test="@type='MULTIPLESTRINGVALUE'"> string_string </xsl:when>
+ <xsl:otherwise> value_string </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ static const <xsl:copy-of select="$val_type" /> <xsl:value-of select="@name"/>_val[] = {<xsl:for-each select="value"> <xsl:choose>
+ <xsl:when test="../@type='INT'">
+ { <xsl:value-of select="@enum"/>, "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:when>
+ <xsl:when test="../@type='STRING'">
+ { "<xsl:value-of select="@enum"/>", "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:when>
+ <xsl:when test="../@type='MULTIPLESTRINGVALUE'">
+ { "<xsl:value-of select="@enum"/>", "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:when>
+ <xsl:otherwise>
+ { '<xsl:value-of select="@enum"/>', "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ { 0, NULL }
+ };
+
+</xsl:for-each>
+</xsl:template>
+
+<xsl:template match="fix/messages">
+ static const string_string messages_val[] = {<xsl:for-each select="message">
+ { "<xsl:value-of select="@msgtype"/>", "<xsl:value-of select="@name"/>" },</xsl:for-each>
+ { "", NULL }
+ };
+</xsl:template>
+
+</xsl:stylesheet>