diff options
-rw-r--r-- | test/expected/enums.h | 4 | ||||
-rw-r--r-- | tools/c-constants-generator.xsl | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/test/expected/enums.h b/test/expected/enums.h index 655cc37..19c27f1 100644 --- a/test/expected/enums.h +++ b/test/expected/enums.h @@ -19,6 +19,8 @@ Library General Public License for more details. extern "C" { #endif + +/* TpTestFlags (bitfield/set of flags, 0 for none) */ /* A set of flags */ typedef enum { TP_TEST_LOWBIT = 1, @@ -27,6 +29,8 @@ typedef enum { # define TP_TEST_HIGHBIT (TP_TEST_HIGHBIT) } TpTestFlags; + +/* TpAdjective (enum) */ /* Adjectives which may be applied to a specification */ typedef enum { TP_LEVERAGING = 0, diff --git a/tools/c-constants-generator.xsl b/tools/c-constants-generator.xsl index 8f7993b..fb14715 100644 --- a/tools/c-constants-generator.xsl +++ b/tools/c-constants-generator.xsl @@ -8,15 +8,16 @@ <xsl:param name="upper-case-prefix" select="'TP_'"/> <xsl:template match="tp:flags"> - <xsl:if test="tp:docstring">/* <xsl:value-of select="tp:docstring"/> */</xsl:if> +/* <xsl:value-of select="concat($mixed-case-prefix, @name)"/> (bitfield/set of flags, 0 for none) */ +<xsl:if test="tp:docstring">/* <xsl:value-of select="tp:docstring"/> */</xsl:if> typedef enum { -<xsl:apply-templates/>} <xsl:value-of select="$mixed-case-prefix"/> - <xsl:value-of select="@name"/>; +<xsl:apply-templates/>} <xsl:value-of select="concat($mixed-case-prefix, @name)"/>; </xsl:template> <xsl:template match="tp:enum"> - <xsl:if test="tp:docstring">/* <xsl:value-of select="tp:docstring"/> */</xsl:if> +/* <xsl:value-of select="concat($mixed-case-prefix, @name)"/> (enum) */ +<xsl:if test="tp:docstring">/* <xsl:value-of select="tp:docstring"/> */</xsl:if> typedef enum { <xsl:apply-templates/>} <xsl:value-of select="$mixed-case-prefix"/> <xsl:value-of select="@name"/>; |