VirtualBox

source: vbox/trunk/doc/manual/docbook-refentry-to-H-help.xsl@ 98110

Last change on this file since 98110 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/VBox-3.0/doc/manual/docbook-refentry-to-manual-overview.xsl58652,​70973
    /branches/VBox-3.2/doc/manual/docbook-refentry-to-manual-overview.xsl66309,​66318
    /branches/VBox-4.0/doc/manual/docbook-refentry-to-manual-overview.xsl70873
    /branches/VBox-4.1/doc/manual/docbook-refentry-to-manual-overview.xsl74233,​78414,​78691,​82579,​85941,​85944-85947,​85949-85950,​85953,​86701,​86728,​87009
    /branches/VBox-4.2/doc/manual/docbook-refentry-to-manual-overview.xsl82653,​86229-86230,​86234,​86529,​91503-91504,​91506-91508,​91510,​91514-91515,​91521
    /branches/VBox-4.3/doc/manual/docbook-refentry-to-manual-overview.xsl91223,​94066,​94839,​94897,​95154,​95164,​95167,​95295,​95338,​95353-95354,​95356,​95367,​95451,​95475,​95477,​95480,​95507,​95640,​95659,​95661,​95663,​98913-98915,​99358
    /branches/VBox-4.3/trunk/doc/manual/docbook-refentry-to-manual-overview.xsl91223
    /branches/andy/draganddrop/doc/manual/docbook-refentry-to-manual-overview.xsl90781-91268
    /branches/andy/guestctrl20/doc/manual/docbook-refentry-to-manual-overview.xsl78916,​78930
    /branches/andy/pdmaudio/doc/manual/docbook-refentry-to-manual-overview.xsl94582,​94641,​94654,​94688,​94778,​94783,​94816,​95197,​95215-95216,​95250,​95279,​95505-95506,​95543,​95694,​96323,​96470-96471,​96582,​96587,​96802-96803,​96817,​96904,​96967,​96999,​97020-97021,​97025,​97050,​97099
    /branches/bird/hardenedwindows/doc/manual/docbook-refentry-to-manual-overview.xsl92692-94610
    /branches/dsen/gui/doc/manual/docbook-refentry-to-manual-overview.xsl79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/doc/manual/docbook-refentry-to-manual-overview.xsl79224,​79228,​79233,​79235,​79258,​79262-79263,​79273,​79341,​79345,​79354,​79357,​79387-79388,​79559-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/doc/manual/docbook-refentry-to-manual-overview.xsl79645-79692
    /trunk/src/doc/manual/docbook-refentry-to-manual-overview.xsl92342
File size: 6.2 KB
Line 
1<?xml version="1.0"?>
2<!--
3 docbook-refentry-to-H-help.xsl:
4 XSLT stylesheet for generating command and sub-command
5 constants header for the built-in help.
6-->
7<!--
8 Copyright (C) 2006-2023 Oracle and/or its affiliates.
9
10 This file is part of VirtualBox base platform packages, as
11 available from https://www.virtualbox.org.
12
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License
15 as published by the Free Software Foundation, in version 3 of the
16 License.
17
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, see <https://www.gnu.org/licenses>.
25
26 SPDX-License-Identifier: GPL-3.0-only
27-->
28
29<xsl:stylesheet
30 version="1.0"
31 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
32 xmlns:str="http://xsltsl.org/string"
33 >
34
35 <xsl:import href="string.xsl"/>
36
37 <xsl:output method="text" version="1.0" encoding="utf-8" indent="yes"/>
38 <xsl:strip-space elements="*"/>
39
40 <xsl:param name="g_sMode" select="not-specified"/>
41
42
43 <!-- Default action, do nothing. -->
44 <xsl:template match="node()|@*"/>
45
46 <!--
47 Generate SCOPE enum for a refentry. We convert the
48 cmdsynopsisdiv/cmdsynopsis IDs into constants.
49 -->
50 <xsl:template match="refentry">
51 <xsl:variable name="RefEntry" select="."/>
52 <xsl:variable name="sRefEntryId" select="@id"/>
53 <xsl:variable name="sBaseNm">
54 <xsl:choose>
55 <xsl:when test="contains($sRefEntryId, '-')"> <!-- Multi level command. -->
56 <xsl:call-template name="str:to-upper">
57 <xsl:with-param name="text" select="translate(substring-after($sRefEntryId, '-'), '-', '_')"/>
58 </xsl:call-template>
59 </xsl:when>
60 <xsl:otherwise> <!-- Simple command. -->
61 <xsl:call-template name="str:to-upper">
62 <xsl:with-param name="text" select="translate($sRefEntryId, '-', '_')"/>
63 </xsl:call-template>
64 </xsl:otherwise>
65 </xsl:choose>
66 </xsl:variable>
67
68 <xsl:choose>
69 <!-- Generate subcommand enums and defines -->
70 <xsl:when test="$g_sMode = 'subcmd'">
71 <!-- Start enum type and start off with the refentry id. -->
72 <xsl:text>
73enum
74{
75#define HELP_SCOPE_</xsl:text>
76 <xsl:value-of select="$sBaseNm"/>
77 <xsl:value-of select="substring(' ',1,56 - string-length($sBaseNm) - 11)"/>
78 <xsl:text> RT_BIT_64(HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_BIT)
79 HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_BIT = 0</xsl:text>
80
81 <!-- Synopsis IDs -->
82 <xsl:for-each select="./refsynopsisdiv/cmdsynopsis[@id != concat('synopsis-', $sRefEntryId)]">
83 <xsl:variable name="sSubNm">
84 <xsl:text>HELP_SCOPE_</xsl:text>
85 <xsl:call-template name="str:to-upper">
86 <xsl:with-param name="text" select="translate(substring-after(substring-after(@id, '-'), '-'), '-', '_')"/>
87 </xsl:call-template>
88 </xsl:variable>
89 <xsl:text>,
90#define </xsl:text>
91 <xsl:value-of select="$sSubNm"/>
92 <xsl:value-of select="substring(' ',1,56 - string-length($sSubNm))"/>
93 <xsl:text> RT_BIT_64(</xsl:text><xsl:value-of select="$sSubNm"/><xsl:text>_BIT)
94 </xsl:text>
95 <xsl:value-of select="$sSubNm"/><xsl:text>_BIT</xsl:text>
96 </xsl:for-each>
97
98 <!-- Add scoping info for refsect1 and refsect2 IDs that aren't part of the synopsis. -->
99 <xsl:for-each select=".//refsect1[@id] | .//refsect2[@id]">
100 <xsl:variable name="sThisId" select="@id"/>
101 <xsl:if test="not($RefEntry[@id = $sThisId]) and not($RefEntry/refsynopsisdiv/cmdsynopsis[@id = concat('synopsis-', $sThisId)])">
102 <xsl:variable name="sSubNm">
103 <xsl:text>HELP_SCOPE_</xsl:text>
104 <xsl:choose>
105 <xsl:when test="contains($sRefEntryId, '-')"> <!-- Multi level command. -->
106 <xsl:call-template name="str:to-upper">
107 <xsl:with-param name="text" select="translate(substring-after(@id, '-'), '-', '_')"/>
108 </xsl:call-template>
109 </xsl:when>
110 <xsl:otherwise> <!-- Simple command. -->
111 <xsl:call-template name="str:to-upper">
112 <xsl:with-param name="text" select="translate(@id, '-', '_')"/>
113 </xsl:call-template>
114 </xsl:otherwise>
115 </xsl:choose>
116 </xsl:variable>
117 <xsl:text>,
118#define </xsl:text>
119 <xsl:value-of select="$sSubNm"/>
120 <xsl:value-of select="substring(' ',1,56 - string-length($sSubNm))"/>
121 <xsl:text> RT_BIT_64(</xsl:text><xsl:value-of select="$sSubNm"/><xsl:text>_BIT)
122 </xsl:text>
123 <xsl:value-of select="$sSubNm"/><xsl:text>_BIT</xsl:text>
124 </xsl:if>
125 </xsl:for-each>
126
127 <!-- Done - complete the enum. -->
128 <xsl:text>,
129 HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_END
130};
131AssertCompile((int)HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_END &gt;= 1);
132AssertCompile((int)HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_END &lt; 64);
133AssertCompile(RT_BIT_64(HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_END - 1) &amp; RTMSGREFENTRYSTR_SCOPE_MASK);
134</xsl:text>
135 </xsl:when>
136
137 <!-- Generate command enum value. -->
138 <xsl:when test="$g_sMode = 'cmd'">
139 <xsl:text> HELP_CMD_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>,
140</xsl:text>
141 </xsl:when>
142
143 <!-- Shouldn't happen. -->
144 <xsl:otherwise>
145 <xsl:message terminate="yes">Bad or missing g_sMode string parameter value.</xsl:message>
146 </xsl:otherwise>
147 </xsl:choose>
148 </xsl:template>
149
150</xsl:stylesheet>
151
Note: See TracBrowser for help on using the repository browser.

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