resources/examples/libgit2/styles/gccxml2def-function.xsl
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 05 Sep 2012 11:13:11 +0000
changeset 25 9718bd0f1028
permissions -rw-r--r--
Style & Makefile fixes for libgit2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
<?xml version="1.0" encoding="iso-8859-2"?>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
<xsl:stylesheet 
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
    version="1.0"
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
  <xsl:import href="gccxml2def-utils.xsl"/>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
  <xsl:template name="function">
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
    <xsl:text>(function </xsl:text>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
    <xsl:call-template name="function-selector"/>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
    <xsl:text>)&#10;</xsl:text>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
  </xsl:template>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
	
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
  <xsl:template name="function-selector">
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
    <xsl:value-of select="./@name"/>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
    <xsl:text>&#10;&#09;(</xsl:text>	  
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
	  
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
    <xsl:for-each select="./Argument">
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
	  <xsl:call-template name="function-argument"/>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
    </xsl:for-each>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
	  
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
    <xsl:text>)&#10;&#09;(return </xsl:text>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
    <xsl:call-template name="c-type-string">
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
      <xsl:with-param name="c-type-id" select="./@returns"/>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
    </xsl:call-template>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
    <xsl:text>)</xsl:text>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
  </xsl:template>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
	
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
  <xsl:template name="function-argument">
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
    <xsl:text>&#10;&#09;&#09;(argument (</xsl:text>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
    <xsl:call-template name="c-type-string">
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
      <xsl:with-param name="c-type-id" select="./@type"/>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
    </xsl:call-template>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
    <xsl:text>) </xsl:text>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
	  
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
    <xsl:if test="@name or not(@name='')">	  
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
      <xsl:if test="starts-with(./@name,'_')">
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
        <xsl:text>arg_</xsl:text>		  
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
	  </xsl:if>			  	     
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
	  <xsl:value-of select="./@name"/>
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
	</xsl:if>	
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
    <xsl:if test="not(@name) or @name=''">
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
	  <xsl:text>arg</xsl:text>	
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
	  <xsl:value-of select="position()"/>		
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
	</xsl:if>	  
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
		
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
    <xsl:text>)</xsl:text>					  	  
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
  </xsl:template>	
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
	
9718bd0f1028 Style & Makefile fixes for libgit2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
</xsl:stylesheet>