VirtualBox

Changeset 56679 in vbox


Ignore:
Timestamp:
Jun 29, 2015 6:26:55 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101321
Message:

Main/cbinding: fix new style reserved attribute "unit" (forgotten change, was still using an attribute pair), and apply the reserved attribute/method logic to the old style recursive structure vtables, too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/cbinding/capiidl.xsl

    r56396 r56679  
    18451845      <xsl:text>)(</xsl:text>
    18461846      <xsl:value-of select="$iface"/>
    1847       <xsl:text> *pThis, PRUint32 *reserved);&#x0A;</xsl:text>
    1848       <xsl:text>    nsresult (*SetInternalAndReservedAttribute</xsl:text>
    1849       <xsl:value-of select="concat(position(), $name)"/>
    1850       <xsl:text>)(</xsl:text>
    1851       <xsl:value-of select="$iface"/>
    1852       <xsl:text> *pThis, PRUint32 reserved);&#x0A;&#x0A;</xsl:text>
     1847      <xsl:text> *pThis, PRUint32 *reserved);&#x0A;&#x0A;</xsl:text>
    18531848    </xsl:for-each>
    18541849  </xsl:if>
     
    18761871<xsl:template match="interface">
    18771872  <xsl:if test="not(@internal='yes')">
     1873    <xsl:variable name="name" select="@name"/>
    18781874    <xsl:text>/* Start of struct </xsl:text>
    1879     <xsl:value-of select="@name"/>
     1875    <xsl:value-of select="$name"/>
    18801876    <xsl:text> declaration */&#x0A;</xsl:text>
    18811877    <xsl:text>#define </xsl:text>
    18821878    <xsl:call-template name="string-to-upper">
    1883       <xsl:with-param name="str" select="@name"/>
     1879      <xsl:with-param name="str" select="$name"/>
    18841880    </xsl:call-template>
    18851881    <xsl:value-of select="concat('_IID_STR &quot;',@uuid,'&quot;')"/>
     
    18871883    <xsl:text>#define </xsl:text>
    18881884    <xsl:call-template name="string-to-upper">
    1889       <xsl:with-param name="str" select="@name"/>
     1885      <xsl:with-param name="str" select="$name"/>
    18901886    </xsl:call-template>
    18911887    <xsl:text>_IID { \&#x0A;</xsl:text>
     
    19051901    <xsl:text>/* COM compatibility */&#x0A;</xsl:text>
    19061902    <xsl:text>VBOX_EXTERN_CONST(nsIID, IID_</xsl:text>
    1907     <xsl:value-of select="@name"/>
     1903    <xsl:value-of select="$name"/>
    19081904    <xsl:text>);&#x0A;</xsl:text>
    19091905    <xsl:text>#ifndef VBOX_WITH_GLUE&#x0A;</xsl:text>
    19101906    <xsl:text>struct </xsl:text>
    1911     <xsl:value-of select="@name"/>
     1907    <xsl:value-of select="$name"/>
    19121908    <xsl:text>_vtbl&#x0A;{&#x0A;</xsl:text>
    19131909    <xsl:text>    </xsl:text>
     
    19281924    <!-- attributes (properties) -->
    19291925    <xsl:apply-templates select="attribute | if/attribute"/>
     1926    <xsl:variable name="reservedAttributes" select="@reservedAttributes"/>
     1927    <xsl:if test="$reservedAttributes > 0">
     1928      <!-- tricky way to do a "for" loop without recursion -->
     1929      <xsl:for-each select="(//*)[position() &lt;= $reservedAttributes]">
     1930        <xsl:text>    nsresult (*GetInternalAndReservedAttribute</xsl:text>
     1931        <xsl:value-of select="concat(position(), $name)"/>
     1932        <xsl:text>)(</xsl:text>
     1933        <xsl:value-of select="$name"/>
     1934        <xsl:text> *pThis, PRUint32 *reserved);&#x0A;&#x0A;</xsl:text>
     1935      </xsl:for-each>
     1936    </xsl:if>
    19301937    <!-- methods -->
    19311938    <xsl:apply-templates select="method | if/method"/>
     1939    <xsl:variable name="reservedMethods" select="@reservedMethods"/>
     1940    <xsl:if test="$reservedMethods > 0">
     1941      <!-- tricky way to do a "for" loop without recursion -->
     1942      <xsl:for-each select="(//*)[position() &lt;= $reservedMethods]">
     1943        <xsl:text>    nsresult (*InternalAndReservedMethod</xsl:text>
     1944        <xsl:value-of select="concat(position(), $name)"/>
     1945        <xsl:text>)(</xsl:text>
     1946        <xsl:value-of select="$name"/>
     1947        <xsl:text> *pThis);&#x0A;&#x0A;</xsl:text>
     1948      </xsl:for-each>
     1949    </xsl:if>
    19321950    <!-- -->
    19331951    <xsl:text>};&#x0A;</xsl:text>
    19341952    <xsl:text>#else /* VBOX_WITH_GLUE */&#x0A;</xsl:text>
    19351953    <xsl:text>struct </xsl:text>
    1936     <xsl:value-of select="@name"/>
     1954    <xsl:value-of select="$name"/>
    19371955    <xsl:text>Vtbl&#x0A;{&#x0A;</xsl:text>
    19381956    <xsl:apply-templates select="." mode="vtab_flat">
    1939       <xsl:with-param name="iface" select="@name"/>
     1957      <xsl:with-param name="iface" select="$name"/>
    19401958    </xsl:apply-templates>
    19411959    <xsl:text>};&#x0A;</xsl:text>
    19421960    <xsl:apply-templates select="." mode="cobjmacro">
    1943       <xsl:with-param name="iface" select="@name"/>
     1961      <xsl:with-param name="iface" select="$name"/>
    19441962    </xsl:apply-templates>
    19451963    <!-- -->
     
    19471965    <xsl:text>&#x0A;</xsl:text>
    19481966    <xsl:text>interface </xsl:text>
    1949     <xsl:value-of select="@name"/>
     1967    <xsl:value-of select="$name"/>
    19501968    <xsl:text>&#x0A;{&#x0A;</xsl:text>
    19511969    <xsl:text>#ifndef VBOX_WITH_GLUE&#x0A;</xsl:text>
    19521970    <xsl:text>    struct </xsl:text>
    1953     <xsl:value-of select="@name"/>
     1971    <xsl:value-of select="$name"/>
    19541972    <xsl:text>_vtbl *vtbl;&#x0A;</xsl:text>
    19551973    <xsl:text>#else /* VBOX_WITH_GLUE */&#x0A;</xsl:text>
    19561974    <xsl:text>    CONST_VTBL struct </xsl:text>
    1957     <xsl:value-of select="@name"/>
     1975    <xsl:value-of select="$name"/>
    19581976    <xsl:text>Vtbl *lpVtbl;&#x0A;</xsl:text>
    19591977    <xsl:text>#endif /* VBOX_WITH_GLUE */&#x0A;</xsl:text>
    19601978    <xsl:text>};&#x0A;</xsl:text>
    19611979    <xsl:text>/* End of struct </xsl:text>
    1962     <xsl:value-of select="@name"/>
     1980    <xsl:value-of select="$name"/>
    19631981    <xsl:text> declaration */&#x0A;&#x0A;</xsl:text>
    19641982    <xsl:call-template name="xsltprocNewlineOutputHack"/>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette