VirtualBox

Changeset 79360 in vbox for trunk/src/VBox/Main/glue


Ignore:
Timestamp:
Jun 26, 2019 1:49:48 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131592
Message:

Main/glue/python: Include the VBox status codes from iprt/err.h and VBox/err.h in the constant.

Location:
trunk/src/VBox/Main/glue
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/constants-python.xsl

    r60463 r79360  
    2525  encoding="utf-8"
    2626  indent="no"/>
     27
     28<xsl:param name="g_sErrHFile"/>
    2729
    2830<xsl:template match="/">
     
    6971        self.__fIsSym = fIsSym
    7072
    71     __dValues = {</xsl:text>
     73    # iprt/err.h + VBox/err.h constants:
     74    __dVBoxStatuses = {</xsl:text>
     75    <xsl:value-of select="document($g_sErrHFile)"/>
    7276
     77    <xsl:text disable-output-escaping="yes"><![CDATA[
     78    }
     79
     80    __dValues = {]]></xsl:text>
    7381    <xsl:for-each select="//enum">
    7482        <xsl:text>
     
    8391        },</xsl:text>
    8492    </xsl:for-each>
    85     <!-- hack alert: force new output element to avoid large reallocations. -->
     93    <!-- VBox status codes: -->
    8694    <xsl:text disable-output-escaping="yes"><![CDATA[
     95        # iprt/err.h + VBox/err.h constants:
     96        'VBoxStatus': __dVBoxStatuses,
    8797    }
    8898
     
    104114    }
    105115
    106     __dValuesFlat = {]]></xsl:text>
     116    __dValuesFlat = dict({]]></xsl:text>
    107117    <xsl:for-each select="//enum">
    108118        <xsl:variable name="ename">
     
    124134        <xsl:value-of select="@value"/><xsl:text>,</xsl:text>
    125135    </xsl:for-each>
     136
    126137    <!-- hack alert: force new output element to avoid large reallocations. -->
    127138    <xsl:text>
    128     }
     139    }, **__dVBoxStatuses)
    129140
    130141    __dValuesFlatSym = {</xsl:text>
  • trunk/src/VBox/Main/glue/vbox-err-consts.sed

    r79338 r79360  
    11# $Id$
    22## @file
    3 # IPRT - SED script for converting */err.h.
     3# IPRT - SED script for converting */err.h to a python dictionary.
    44#
    55
     
    2525#
    2626
     27# Header and footer text:
     281i <text>
     29$a </text>
     30
    2731# Handle text inside the markers.
    2832/SED-START/,/SED-END/{
     
    3135/^[[:space:]]*#[[:space:]]*define/b defines
    3236
    33 # if (/**) goto description
    34 /\/\*\*/b description
    35 
    3637}
    3738
    3839# Everything else is deleted!
     40:delete
    3941d
    4042b end
     
    4446# Convert the defines
    4547:defines
    46 s/^[[:space:]]*#[[:space:]]*define[[:space:]]*\([[:alnum:]_]*\)[[:space:]]*\(.*\)[[:space:]]*$/    "\1",\n     \1 }, /
    47 b end
    4848
    49 ##
    50 # Convert descriptive comments. /** desc */
    51 :description
     49/^[[:space:]]*#[[:space:]]*define[[:space:]]*\([[:alnum:]_]*\)[[:space:](]*\([-+]*[[:space:]]*[[:digit:]][[:digit:]]*\)[[:space:])]*$/b define_okay
     50b delete
     51:define_okay
     52s/^[[:space:]]*#[[:space:]]*define[[:space:]]*\([[:alnum:]_]*\)[[:space:](]*\([-+]*[[:space:]]*[[:digit:]][[:digit:]]*\)[[:space:])]*$/        '\1': \2,/
    5253
    53 # Read all the lines belonging to the comment into the buffer.
    54 :look-for-end-of-comment
    55 /\*\//bend-of-comment
    56 N
    57 blook-for-end-of-comment
    58 :end-of-comment
    59 
    60 # anything with @{ and @} is skipped
    61 /@[\{\}]/d
    62 
    63 # Fix double spaces
    64 s/[[:space:]][[:space:]]/ /g
    65 
    66 # Fix \# sequences (doxygen needs them, we don't).
    67 s/\\#/#/g
    68 
    69 # insert punctuation.
    70 s/\([^.[:space:]]\)[[:space:]]*\*\//\1. \*\//
    71 
    72 # convert /** short. more
    73 s/[[:space:]]*\/\*\*[[:space:]]*/  { NULL, \"/
    74 s/  { NULL, \"\([^.!?"]*[.!?][.!?]*\)/  { \"\1\",\n    \"\1/
    75 
    76 # terminate the string
    77 s/[[:space:]]*\*\//\"\,/
    78 
    79 # translate empty lines into new-lines (only one, please).
    80 s/[[:space:]]*[[:space:]]\*[[:space:]][[:space:]]*\*[[:space:]][[:space:]]*/\\n/g
    81 
    82 # remove asterics.
    83 s/[[:space:]]*[[:space:]]\*[[:space:]][[:space:]]*/ /g
    8454b end
    8555
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