summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-06-07 11:45:38 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2007-06-07 11:45:38 +0000
commit18981b9ccbee44b6db0dcbce68f4414db9585a11 (patch)
tree53d6c5185816c2367fe71592562fe695f64bd877 /extensions
parentc8c309ddc557359c1cffa9f20117e84f8a15695d (diff)
downloadtelepathy-salut-18981b9ccbee44b6db0dcbce68f4414db9585a11.tar.gz
Update c-interfaces-generator.xsl from telepathy-glib.
It now takes a --stringparam to set the prefix for interface constants. Also use the generated SALUT_IFACE_OLPC_BUDDY_INFO in salut-connection.c. 20070607114538-53eee-7cdbed4e64c697c71f4364f3dfc3e869b6cd0551.gz
Diffstat (limited to 'extensions')
-rw-r--r--extensions/Makefile.am16
-rw-r--r--extensions/tools/c-interfaces-generator.xsl70
2 files changed, 58 insertions, 28 deletions
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index f26ce34a..a9f3a7d9 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -76,18 +76,4 @@ _gen/signals-marshal.h: _gen/signals-marshal.list
_gen/signals-marshal.c: _gen/signals-marshal.list
$(GLIB_GENMARSHAL) --body --prefix=_salut_ext_marshal $< > $@
-_gen/svc.h: Makefile.in _gen/.exists
- for i in $(SPEC_INTERFACES); \
- do \
- echo "#include \"extensions/_gen/svc-$$i.h\""; \
- done > $@
-
-_gen/enums.h: all.xml tools/c-constants-generator.xsl _gen/.exists
- $(XSLTPROC) --xinclude $(XSLTPROCFLAGS) \
- $(srcdir)/tools/c-constants-generator.xsl \
- $(srcdir)/all.xml > $@
-
-_gen/interfaces.h: all.xml tools/c-interfaces-generator.xsl _gen/.exists
- $(XSLTPROC) --xinclude $(XSLTPROCFLAGS) \
- $(srcdir)/tools/c-interfaces-generator.xsl \
- $(srcdir)/all.xml > $@
+endif
diff --git a/extensions/tools/c-interfaces-generator.xsl b/extensions/tools/c-interfaces-generator.xsl
index 3c464521..8cd2a590 100644
--- a/extensions/tools/c-interfaces-generator.xsl
+++ b/extensions/tools/c-interfaces-generator.xsl
@@ -1,18 +1,49 @@
+<!-- Stylesheet to extract C enumerations from the Telepathy spec.
+
+Copyright (C) 2006, 2007 Collabora Limited
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+-->
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
exclude-result-prefixes="tp">
+ <xsl:param name="mixed-case-prefix" select="''"/>
+
+ <xsl:variable name="PREFIX"
+ select="translate($mixed-case-prefix, $lower, $upper)"/>
+ <xsl:variable name="Prefix" select="$mixed-case-prefix"/>
+ <xsl:variable name="prefix"
+ select="translate($mixed-case-prefix, $upper, $lower)"/>
+
<xsl:output method="text" indent="no" encoding="ascii"/>
<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:template match="interface">
- <xsl:text>/**&#10; * TP_IFACE_</xsl:text>
+ <xsl:text>/**&#10; * </xsl:text>
+ <xsl:value-of select="$PREFIX"/>
+ <xsl:text>_IFACE_</xsl:text>
<xsl:value-of select="translate(../@name, concat($lower, '/'), $upper)"/>
- <xsl:text>:&#10; * &#10; * The Telepathy interface name "</xsl:text>
+ <xsl:text>:&#10; * &#10; * The interface name "</xsl:text>
<xsl:value-of select="@name"/>
- <xsl:text>"&#10; */&#10;#define TP_IFACE_</xsl:text>
+ <xsl:text>"&#10; */&#10;#define </xsl:text>
+ <xsl:value-of select="$PREFIX"/>
+ <xsl:text>_IFACE_</xsl:text>
<xsl:value-of select="translate(../@name, concat($lower, '/'), $upper)"/>
<xsl:text> \&#10;"</xsl:text>
<xsl:value-of select="@name"/>
@@ -21,17 +52,30 @@
<xsl:template match="text()"/>
- <xsl:template match="/tp:spec">/* Generated from the Telepathy spec
+ <xsl:template match="/tp:spec">
+ <xsl:if test="$mixed-case-prefix = ''">
+ <xsl:message terminate="yes">
+ <xsl:text>mixed-case-prefix param must be set&#10;</xsl:text>
+ </xsl:message>
+ </xsl:if>
-<xsl:for-each select="tp:copyright">
-<xsl:value-of select="."/><xsl:text>
-</xsl:text></xsl:for-each><xsl:text>
-</xsl:text><xsl:value-of select="tp:license"/>
-<xsl:value-of select="tp:docstring"/>
-*/
-
-<xsl:apply-templates select="node"/>
-</xsl:template>
+ <xsl:text>/* Generated from: </xsl:text>
+ <xsl:value-of select="tp:title"/>
+ <xsl:if test="tp:version">
+ <xsl:text> version </xsl:text>
+ <xsl:value-of select="tp:version"/>
+ </xsl:if>
+ <xsl:text>&#10;&#10;</xsl:text>
+ <xsl:for-each select="tp:copyright">
+ <xsl:value-of select="."/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:for-each>
+ <xsl:text>&#10;</xsl:text>
+ <xsl:value-of select="tp:license"/>
+ <xsl:value-of select="tp:docstring"/>
+ <xsl:text>&#10; */&#10;&#10;</xsl:text>
+ <xsl:apply-templates select="node"/>
+ </xsl:template>
</xsl:stylesheet>