<commit_before><?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes" method="text" />

  <xsl:variable name="lowercase">abcdefghijklmnopqrstuvwxyz</xsl:variable>
  <xsl:variable name="uppercase">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>

  <xsl:template match="/">
    <xsl:text><![CDATA[
/* Automatically-generated code, do not modify! */

#ifndef RFC822PROTO_H__
#define RFC822PROTO_H__

typedef enum RFC822_Protocols {
    RFC822_Protocol_Unsupported = -1,
]]></xsl:text>
    
    <xsl:for-each select="supportedproto">
      <xsl:for-each select="supportedversion">
	<xsl:text>    RFC822_Protocol_</xsl:text>
	<xsl:value-of select="../@name" />
	<xsl:value-of select="translate(., '.', '')" />
	<xsl:text><![CDATA[,
]]></xsl:text>
      </xsl:for-each>

      <xsl:text>    RFC822_Protocol_</xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_UnsupportedVersion,
]]></xsl:text>
    </xsl:for-each>
    
    <xsl:text><![CDATA[
} RFC822_Protocols;

]]></xsl:text>

    <xsl:for-each select="//supportedproto">
      <xsl:text>typedef enum </xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_Methods {
]]></xsl:text>

      <xsl:text>    </xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_Method__Unsupported,
]]></xsl:text>
      
      <xsl:for-each select="supportedmethod">
	<xsl:text>    </xsl:text>
	<xsl:value-of select="../@name" />
	<xsl:text>_Method_</xsl:text>
	<xsl:value-of select="." />
	<xsl:text><![CDATA[,
]]></xsl:text>
      </xsl:for-each>

    <xsl:text><![CDATA[
} ]]></xsl:text>
    <xsl:value-of select="@name" />
    <xsl:text><![CDATA[_Methods;

]]></xsl:text>

      <xsl:text>typedef enum </xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_Headers {
]]></xsl:text>

      <xsl:text>    </xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_Header__Unsupported,
]]></xsl:text>

      <xsl:for-each select="supportedheader">
	<xsl:text>    </xsl:text>
	<xsl:value-of select="../@name" />
	<xsl:text>_Header_</xsl:text>
	<xsl:value-of select="translate(., '-', '_')" />
	<xsl:text><![CDATA[,
]]></xsl:text>
      </xsl:for-each>

    <xsl:text><![CDATA[
} ]]></xsl:text>
    <xsl:value-of select="@name" />
    <xsl:text><![CDATA[_Headers;

]]></xsl:text>

    <xsl:text>const char *</xsl:text>
    <xsl:value-of select="translate(@name, $uppercase, $lowercase)" />
    <xsl:text>_header_to_string(</xsl:text>
    <xsl:value-of select="@name" />
    <xsl:text>_Headers hdr);</xsl:text>

    </xsl:for-each><commit_msg>Use -1 as constant value for the Unsupported case.<commit_after><?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes" method="text" />

  <xsl:variable name="lowercase">abcdefghijklmnopqrstuvwxyz</xsl:variable>
  <xsl:variable name="uppercase">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>

  <xsl:template match="/">
    <xsl:text><![CDATA[
/* Automatically-generated code, do not modify! */

#ifndef RFC822PROTO_H__
#define RFC822PROTO_H__

typedef enum RFC822_Protocols {
    RFC822_Protocol_Unsupported = -1,
]]></xsl:text>
    
    <xsl:for-each select="supportedproto">
      <xsl:for-each select="supportedversion">
	<xsl:text>    RFC822_Protocol_</xsl:text>
	<xsl:value-of select="../@name" />
	<xsl:value-of select="translate(., '.', '')" />
	<xsl:text><![CDATA[,
]]></xsl:text>
      </xsl:for-each>

      <xsl:text>    RFC822_Protocol_</xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_UnsupportedVersion,
]]></xsl:text>
    </xsl:for-each>
    
    <xsl:text><![CDATA[
} RFC822_Protocols;

]]></xsl:text>

    <xsl:for-each select="//supportedproto">
      <xsl:text>typedef enum </xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_Methods {
]]></xsl:text>

      <xsl:text>    </xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_Method__Unsupported = -1,
]]></xsl:text>
      
      <xsl:for-each select="supportedmethod">
	<xsl:text>    </xsl:text>
	<xsl:value-of select="../@name" />
	<xsl:text>_Method_</xsl:text>
	<xsl:value-of select="." />
	<xsl:text><![CDATA[,
]]></xsl:text>
      </xsl:for-each>

    <xsl:text><![CDATA[
} ]]></xsl:text>
    <xsl:value-of select="@name" />
    <xsl:text><![CDATA[_Methods;

]]></xsl:text>

      <xsl:text>typedef enum </xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_Headers {
]]></xsl:text>

      <xsl:text>    </xsl:text>
      <xsl:value-of select="@name" />
      <xsl:text><![CDATA[_Header__Unsupported = -1,
]]></xsl:text>

      <xsl:for-each select="supportedheader">
	<xsl:text>    </xsl:text>
	<xsl:value-of select="../@name" />
	<xsl:text>_Header_</xsl:text>
	<xsl:value-of select="translate(., '-', '_')" />
	<xsl:text><![CDATA[,
]]></xsl:text>
      </xsl:for-each>

    <xsl:text><![CDATA[
} ]]></xsl:text>
    <xsl:value-of select="@name" />
    <xsl:text><![CDATA[_Headers;

]]></xsl:text>

    <xsl:text>const char *</xsl:text>
    <xsl:value-of select="translate(@name, $uppercase, $lowercase)" />
    <xsl:text>_header_to_string(</xsl:text>
    <xsl:value-of select="@name" />
    <xsl:text>_Headers hdr);</xsl:text>

    </xsl:for-each>
{'fraction_non_alphanumeric': 0.23149693934335003, 'fraction_numerical': 0.01242812094231126, 'mean_word_length': 3.9062784349408552, 'pattern_counts': {'":': 0, '<': 205, '<?xml version=': 2, '>': 205, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2536790', 'n_tokens_mistral': 2344, 'n_tokens_neox': 2053, 'n_words': 271}