1
<?xml version="1.0" encoding="ISO-8859-15" ?>
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
5
<xsl:template match="/">
7
<xsl:text>/* * Automatically generated C config: don't edit */ </xsl:text>
9
<!-- scan all config options -->
10
<xsl:for-each select="config/option">
13
<!-- config option "boolean" -->
14
<xsl:when test="@type='boolean'">
16
<xsl:when test="@value='true'">
17
<xsl:text>#define </xsl:text>
18
<xsl:value-of select="@name"/>
19
<xsl:text> 1</xsl:text>
21
<xsl:when test="@value='false'">
22
<xsl:text>#undef </xsl:text>
23
<xsl:value-of select="@name"/>
26
<xsl:message terminate="yes"> ERROR: boolean configuration option '<xsl:value-of select="@name"/>' has unsupported value '<xsl:value-of select="@type"/>' instead of [true|false].</xsl:message>
31
<!-- config option "integer" -->
32
<xsl:when test="@type='integer'">
33
<xsl:text>#define </xsl:text>
34
<xsl:value-of select="@name"/><xsl:text> </xsl:text>
35
<xsl:value-of select="@value"/>
38
<!-- config option "string" -->
39
<xsl:when test="@type='string'">
40
<xsl:text>#define </xsl:text>
41
<xsl:value-of select="@name"/><xsl:text> </xsl:text> "<xsl:value-of select="@value"/>" </xsl:when>
43
<!-- unsupported config option: bail out -->
45
<xsl:message terminate="yes"> ERROR: configuration option '<xsl:value-of select="@name"/> has unsupported type '<xsl:value-of select="@type"/>'.</xsl:message>
50
<xsl:text> </xsl:text>
55
<xsl:output method="text" indent="no" encoding="iso-8859-15"/>