VirtualBox

Changeset 68860 in vbox


Ignore:
Timestamp:
Sep 25, 2017 8:04:07 PM (7 years ago)
Author:
vboxsync
Message:

iprt,vboxmanage,manual: Try write the iso maker docs as a docbook refentry document. Tried to generalize the vboxmanage refentry output handling, moving it to RTMsg*. Made VBoxManage and IPRT generate their C/H sources in their own Makefiles. Hacked the C/H source generation till it can deal with the rather different RTIsoMaker command structure (no sub or sub-sub command stuff).

Location:
trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/Makefile.kmk

    r68829 r68860  
    4949include $(KBUILD_PATH)/subheader.kmk
    5050
     51ifndef VBOX_DOC_MANUAL_CONFIG_KMK_INCLUDED
     52 include $(PATH_SUB_CURRENT)/Config.kmk
     53endif
     54
    5155
    5256#
     
    8387endif
    8488
    85 # Source and output locations.
    86 VBOX_PATH_MANUAL_SRC     := $(PATH_SUB_CURRENT)
    87 VBOX_PATH_MANUAL_OUTBASE := $(PATH_TARGET)/manual
    88 
    89 # tool locations
    90 ifndef VBOX_OSE
    91  # use docbook from our tools directory
    92  VBOX_PATH_DOCBOOK        ?= $(PATH_DEVTOOLS)/common/DocBook/v1.69.1
    93  VBOX_PATH_DOCBOOK_DTD    ?= $(PATH_DEVTOOLS)/common/docbook-xml/v4.3
    94  VBOX_XML_CATALOG         ?= $(VBOX_PATH_MANUAL_OUTBASE)/catalog
    95  VBOX_XML_CATALOG_DOCBOOK ?= $(VBOX_PATH_MANUAL_OUTBASE)/docbook
    96 else
    97  # use docbook of the build host
    98  VBOX_PATH_DOCBOOK        ?= http://docbook.sourceforge.net/release/xsl/current/
    99 endif
    100 
    101 # xsltproc with the catalog trick if applicable.
    102 ifdef VBOX_XML_CATALOG
    103  VBOX_XSLTPROC_WITH_CAT    = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" $1 -- \
    104         $(VBOX_XSLTPROC) --nonet --xinclude $(VBOX_XSLTPROC_OPTS)
    105  VBOX_XMLLINT_WITH_CAT     = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" -- \
    106         $(VBOX_XMLLINT) --nonet --xinclude --noout $(VBOX_XMLLINT_OPTS)
    107 else
    108  VBOX_XSLTPROC_WITH_CAT    = $(if $(1), $(REDIRECT) $1 --,) $(VBOX_XSLTPROC) --nonet --xinclude $(VBOX_XSLTPROC_OPTS)
    109  VBOX_XMLLINT_WITH_CAT     = $(VBOX_XMLLINT) --nonet --xinclude --noout $(VBOX_XMLLINT_OPTS)
    110 endif
     89
    11190
    11291VBOXMANAGEHELP_PATH       ?= $(PATH_STAGE_BIN)/VBoxManageHelp$(SUFF_EXE)
     
    145124VBOX_DOC_XIDL_SRC_TMP  = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.xidl.tmp
    146125
    147 ##
    148 # Non-pattern-rule approach to editing XSLT files.
    149 # $(evalcall2 def_vbox_replace_paths_in_xslt)
    150 # @param    1   The XSLT source file (relative to Makefile dir).
    151 # @param    2   Optional output subdirectory (leading slash).
    152 define def_vbox_replace_paths_in_xslt
    153 OTHER_CLEAN += $$(VBOX_PATH_MANUAL_OUTBASE)$2/$(notdir $1)
    154 $$(VBOX_PATH_MANUAL_OUTBASE)$2/$(notdir $1): $$(VBOX_PATH_MANUAL_SRC)/$1 | $$$$(dir $$$$@)
    155         $$(call MSG_L1,Pre-processing $$(<) to $$(@))
    156         $$(QUIET)$$(SED) \
    157                 -e 's|@VBOX_PATH_DOCBOOK@|$$(VBOX_PATH_DOCBOOK)|g' \
    158                 -e 's|@VBOX_PATH_MANUAL_SRC@|$$(VBOX_PATH_MANUAL_SRC)|g' \
    159                 -e 's|@VBOX_PATH_MANUAL_OUTBASE@|$$(VBOX_PATH_MANUAL_OUTBASE)|g' \
    160                 -e 's|@VBOX_PATH_MANUAL_OUT_LANG@|$$(VBOX_PATH_MANUAL_OUTBASE)$2|g' \
    161                 --output "$$(@)" $$<
    162 endef
    163126
    164127##
     
    189152endef
    190153
    191 ## List of refentry files (manpages).
    192 VBOX_MANUAL_XML_REFENTRY_FILES = \
    193         man_VBoxManage-debugvm.xml \
    194         man_VBoxManage-extpack.xml \
    195         man_VBoxManage-unattended.xml
    196154
    197155
     
    200158#
    201159
    202 BLDDIRS += $(VBOX_PATH_MANUAL_OUTBASE) $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, $(VBOX_MANUAL_LANGUAGES))
     160BLDDIRS += $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, $(VBOX_MANUAL_LANGUAGES))
    203161
    204162
     
    314272               $(addprefix user_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
    315273               $(patsubst man_%,%.1,$(basename $(VBOX_MANUAL_XML_REFENTRY_FILES))) \
     274               isomakercmd-man.xml \
     275               user_isomakercmd-man.xml \
    316276                $(VBOX_MANUAL_LATEX_FILES_TARGET) \
    317277                $(VBOX_MANUAL_PNG_FILES_$(lang)) \
     
    342302        $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
    343303        $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml \
    344         $(VBOX_PATH_MANUAL_OUTBASE)/user_AdvancedTopics_VISO_Options.xml \
    345304        $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf) \
    346305        $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm) \
     
    419378
    420379
    421 #
    422 # To avoid network I/O for fetching DTDs, we generate catalogs mapping the public
    423 # entity IDs to local files.  (Obviously, only done when we have local files.)
    424 #
    425 ifdef VBOX_XML_CATALOG
    426 # Create a catalog file for xsltproc that points to docbook catalog.
    427 $(VBOX_XML_CATALOG): $(MAKEFILE_CURRENT) | $$(dir $$@)
    428         $(call MSG_L1,Creating catalog $@)
    429         $(QUIET)$(RM) -f [email protected] $@
    430         $(QUIET)$(APPEND) [email protected] '<?xml version="1.0"?>'
    431         $(QUIET)$(APPEND) [email protected] '<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">'
    432         $(QUIET)$(APPEND) [email protected] '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">'
    433         $(QUIET)$(APPEND) [email protected] '  <delegatePublic publicIdStartString="-//OASIS/ENTITIES DocBook XML"      catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
    434         $(QUIET)$(APPEND) [email protected] '  <delegatePublic publicIdStartString="-//OASIS/DTD DocBook XML"           catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
    435         $(QUIET)$(APPEND) [email protected] '  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
    436         $(QUIET)$(APPEND) [email protected] '  <delegateURI uriStartString="http://www.oasis-open.org/docbook/"         catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
    437         $(QUIET)$(APPEND) [email protected] '</catalog>'
    438         $(QUIET)$(MV) -f [email protected] $@
    439 
    440 # Create a docbook catalog file for xsltproc that points to the local docbook files.
    441 $(VBOX_XML_CATALOG_DOCBOOK): $(MAKEFILE_CURRENT) | $$(dir $$@)
    442         $(call MSG_L1,Creating catalog $@)
    443         $(QUIET)$(RM) -f [email protected] $@
    444         $(QUIET)$(APPEND) [email protected] '<?xml version="1.0"?>'
    445         $(QUIET)$(APPEND) [email protected] '<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">'
    446         $(QUIET)$(APPEND) [email protected] '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">'
    447         $(QUIET)$(APPEND) [email protected] '  <public publicId="-//OASIS//ELEMENTS DocBook XML Information Pool V4.3//EN"          uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbpoolx.mod"/>'
    448         $(QUIET)$(APPEND) [email protected] '  <public publicId="-//OASIS//DTD DocBook XML V4.3//EN"                                uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd"/>'
    449         $(QUIET)$(APPEND) [email protected] '  <public publicId="-//OASIS//DTD DocBook XML V4.4//EN"                                uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd"/>'
    450         $(QUIET)$(APPEND) [email protected] '  <public publicId="-//OASIS//ENTITIES DocBook XML Character Entities V4.3//EN"        uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbcentx.mod"/>'
    451         $(QUIET)$(APPEND) [email protected] '  <public publicId="-//OASIS//ENTITIES DocBook XML Notations V4.3//EN"                 uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbnotnx.mod"/>'
    452         $(QUIET)$(APPEND) [email protected] '  <public publicId="-//OASIS//ENTITIES DocBook XML Additional General Entities V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbgenent.mod"/>'
    453         $(QUIET)$(APPEND) [email protected] '  <public publicId="-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.3//EN"        uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbhierx.mod"/>'
    454         $(QUIET)$(APPEND) [email protected] '  <public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"               uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/soextblx.dtd"/>'
    455         $(QUIET)$(APPEND) [email protected] '  <public publicId="-//OASIS//DTD DocBook XML CALS Table Model V4.3//EN"               uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/calstblx.dtd"/>'
    456         $(QUIET)$(APPEND) [email protected] '  <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
    457         $(QUIET)$(APPEND) [email protected] '  <rewriteURI         uriStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
    458         $(QUIET)$(APPEND) [email protected] '  <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
    459         $(QUIET)$(APPEND) [email protected] '  <rewriteURI         uriStartString="http://www.oasis-open.org/docbook/xml/4.4" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
    460         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN"   uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsa.ent"/>'
    461         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN"  uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsb.ent"/>'
    462         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN"        uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsc.ent"/>'
    463         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsn.ent"/>'
    464         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN"          uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amso.ent"/>'
    465         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN"         uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsr.ent"/>'
    466         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN"                  uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-box.ent"/>'
    467         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN"                      uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-cyr1.ent"/>'
    468         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN"                  uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-cyr2.ent"/>'
    469         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN"                     uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-dia.ent"/>'
    470         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN"                         uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk1.ent"/>'
    471         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN"                      uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk2.ent"/>'
    472         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN"                         uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk3.ent"/>'
    473         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN"             uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk4.ent"/>'
    474         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN"                         uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-lat1.ent"/>'
    475         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN"                         uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-lat2.ent"/>'
    476         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN"           uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-num.ent"/>'
    477         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES Publishing//EN"                            uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-pub.ent"/>'
    478         $(QUIET)$(APPEND) [email protected] '  <public publicId="ISO 8879:1986//ENTITIES General Technical//EN"                     uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-tech.ent"/>'
    479         $(QUIET)$(APPEND) [email protected] '</catalog>'
    480         $(QUIET)$(MV) -f [email protected] $@
    481 endif
    482 
    483380
    484381if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
     
    520417        $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
    521418        $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
    522         $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml \
    523         $(VBOX_PATH_MANUAL_OUTBASE)/user_AdvancedTopics_VISO_Options.xml ))
     419        $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml ))
     420
     421# Manual dependency for user_AdvancedTopics.xml.
     422$(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
     423,$(eval $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_AdvancedTopics.xml: $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_isomakercmd-man.xml))
    524424
    525425# Intermediate step to do some variable replacement in the document.
     
    530430# Morph man pages into manual sections.
    531431# $(evalcall2 def_vbox_refentry_to_user_sect1)
    532 # @param    1   The XSLT source file (relative to Makefile dir).
    533 # @param    2   Optional output subdirectory.
     432# @param    1  Language.
     433# @param    2  the refentry xml base file name.
     434# @param    3  the full refentry xml file path.
    534435define def_vbox_refentry_to_user_sect1
    535 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/user_$(2): \
    536                 $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
     436$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/user_$(2): $(3) \
    537437                $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl \
    538438                $$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
     
    543443endef
    544444$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
    545 , $(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),$(file))))
     445, $(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),$(file),$(VBOX_PATH_MANUAL_SRC)/$(lang)/$(file))))
     446$(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
     447,$(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),isomakercmd-man.xml,$(PATH_ROOT)/src/VBox/Runtime/common/fs/isomakercmd-man.xml))
    546448
    547449
     
    584486               '</sect1>'
    585487
    586 # Generate the VISO option listing.
    587 $(VBOX_PATH_MANUAL_OUTBASE)/user_AdvancedTopics_VISO_Options.xml: $(VBOX_RTISOMAKER) $(MAKEFILE_CURRENT) | $$(dir $$@)
    588         $(call MSG_GENERATE,,$@,)
    589         $(QUIET)$(RM) -f $@ [email protected]
    590         $(QUIET)$(APPEND) -tn "$@" \
    591                 '<?xml version="1.0" encoding="UTF-8"?>' \
    592                '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">' \
    593                '<sect1> <!-- this will be skipped via xpointer in the include. --> '
    594         $(QUIET)$(REDIRECT) -wo [email protected] -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
    595                 -- $(VBOX_RTISOMAKER) --help
    596         $(QUIET)$(SED) \
    597                 -e ':a' \
    598                 -e 'N' \
    599                 -e '$(DOLLAR)!ba' \
    600                 -e 's/bldRTIsoMaker/RTIsoMaker/' \
    601                 -e 's/&/\&amp\;/g' \
    602                 -e 's/</\&lt\;/g' \
    603                 -e 's/>/\&gt\;/g' \
    604                 -e 's/\n*$(DOLLAR)/<\/screen>/' \
    605                 -e 's/^/<screen>/' \
    606                 --append $@ [email protected]
    607         $(QUIET)$(RM) -f [email protected]
    608         $(QUIET)$(APPEND) -n "$@" \
    609                '</sect1>'
    610 
    611488
    612489
     
    644521##########################################################################################
    645522
    646 $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/UserManual.pdf): \
     523$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/UserManual.pdf): \
    647524                $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.pdf : \
    648525                $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.tex \
     
    1029906
    1030907
    1031 #
    1032 # VBoxManage built-in help.
    1033 #
    1034 # Note! Generating the stuff here is a bit annoying, but currently the most
    1035 #       practical way I can come up with.
    1036 #
    1037 OTHERS += \
    1038         $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp \
    1039         $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h
    1040 OTHER_CLEAN += \
    1041         $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp \
    1042         $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp.ts \
    1043         $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h \
    1044         $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h.ts
    1045 help-experiment:: \
    1046         $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp \
    1047         $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h
    1048 
    1049 $(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-C-help.xsl,)
    1050 $(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-H-help.xsl,)
    1051 
    1052 $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-C-help.xsl: $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl # manual dependency.
    1053 
    1054 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp.ts \
    1055 +| $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp: \
    1056                 $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-C-help.xsl \
    1057                 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
    1058                 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
    1059         $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(filter %.xml,$^),$(patsubst %.ts,%,$@))
    1060         $(QUIET)$(APPEND) -tn "$@" \
    1061                 '/* Autogenerated by $<, do not edit! */' \
    1062                 '' \
    1063                 '#include <iprt/types.h>' \
    1064                 '#include "VBoxManageBuiltInHelp.h"' \
    1065                 ''
    1066         $(foreach refentry,$(filter %.xml,$^) \
    1067         ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") $< $(refentry))
    1068         $(QUIET)$(APPEND) -n "$@" \
    1069         '' \
    1070                 'PCREFENTRY     g_apHelpEntries[] = ' \
    1071                 '{'
    1072         $(foreach refentry,$(filter %.xml,$^) \
    1073                 ,$(NLTAB)$(QUIET)$(APPEND) -n "$@" \
    1074                 '    &g_$(subst -,_,$(tolower $(patsubst man_%,%,$(notdir $(basename $(refentry)))))), ')
    1075         $(QUIET)$(APPEND) -n "$@" \
    1076                 '};' \
    1077                 'const uint32_t g_cHelpEntries = RT_ELEMENTS(g_apHelpEntries);' \
    1078                ''
    1079         $(QUIET)$(CP) --changed -- "$@" "$(patsubst %.ts,%,$@)"
    1080 # The above APPEND stuff trigger some kind of problem on some boxes when not split up...
    1081 # update: Fixed in SVN (strcpy -> memmove in new_job(), job.c - r2591). Just need to rebuild all platforms.
    1082 
    1083 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h.ts \
    1084 +| $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h: \
    1085                 $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-H-help.xsl \
    1086                 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
    1087                 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
    1088         $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(filter %.xml,$^),$(patsubst %.ts,%,$@))
    1089         $(QUIET)$(APPEND) -tn "$@" \
    1090                 '/* Autogenerated by $<, do not edit! */' \
    1091                '' \
    1092                '#ifndef ___VBoxManageBuiltInHelp_h___' \
    1093                '#define ___VBoxManageBuiltInHelp_h___' \
    1094                '' \
    1095                '#include <VBox/refentry.h>' \
    1096                '' \
    1097                'RT_C_DECLS_BEGIN' \
    1098                '' \
    1099                'typedef enum HELP_CMD_VBOXMANAGE' \
    1100                '{' \
    1101                '    HELP_CMD_VBOXMANAGE_INVALID = 0,'
    1102         $(foreach refentry,$(filter %.xml,$^) \
    1103         ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") \
    1104                 --stringparam 'g_sMode' 'cmd' $< $(refentry))
    1105         $(QUIET)$(APPEND) -n "$@" \
    1106                 '    HELP_CMD_VBOXMANAGE_END' \
    1107                 '} HELP_CMD_VBOXMANAGE;'
    1108         $(foreach refentry,$(filter %.xml,$^) \
    1109         ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") \
    1110                 --stringparam 'g_sMode' 'subcmd' $< $(refentry))
    1111         $(QUIET)$(APPEND) -n "$@" \
    1112                 '' \
    1113                 'extern PCREFENTRY     g_apHelpEntries[];' \
    1114                 'extern const uint32_t g_cHelpEntries;' \
    1115                 '' \
    1116                'RT_C_DECLS_END' \
    1117                 '' \
    1118                 '#endif' \
    1119                ''
    1120         $(QUIET)$(CP) --changed -- "$@" "$(patsubst %.ts,%,$@)"
    1121 
    1122908
    1123909include $(FILE_KBUILD_SUB_FOOTER)
  • trunk/doc/manual/docbook-refentry-to-C-help.xsl

    r56586 r68860  
    7878    <xsl:text>
    7979
    80 static const REFENTRYSTR </xsl:text><xsl:value-of select="$sDataBaseSym"/><xsl:text>_synopsis[] =
     80static const RTMSGREFENTRYSTR </xsl:text><xsl:value-of select="$sDataBaseSym"/><xsl:text>_synopsis[] =
    8181{</xsl:text>
    8282    <xsl:for-each select="./refsynopsisdiv/cmdsynopsis">
     
    104104      -->
    105105    <xsl:text>
    106 static const REFENTRYSTR </xsl:text><xsl:value-of select="$sDataBaseSym"/><xsl:text>_full_help[] =
     106static const RTMSGREFENTRYSTR </xsl:text><xsl:value-of select="$sDataBaseSym"/><xsl:text>_full_help[] =
    107107{</xsl:text>
    108108    <!-- We start by combining the refentry title and the refpurpose into a short description. -->
     
    118118        </xsl:call-template>
    119119        <xsl:text>." },
    120     {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     120    {   RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    121121
    122122    <!-- The follows the usage (synopsis) section. -->
    123123    <xsl:text>
    124     {   REFENTRYSTR_SCOPE_GLOBAL,
     124    {   RTMSGREFENTRYSTR_SCOPE_GLOBAL,
    125125        "Usage" },
    126     {   REFENTRYSTR_SCOPE_SAME,
     126    {   RTMSGREFENTRYSTR_SCOPE_SAME,
    127127        "=====" },
    128     {   REFENTRYSTR_SCOPE_SAME,
     128    {   RTMSGREFENTRYSTR_SCOPE_SAME,
    129129        "" },</xsl:text>
    130130        <xsl:apply-templates select="./refsynopsisdiv/node()"/>
     
    140140        <xsl:text>
    141141    {   </xsl:text><xsl:call-template name="calc-scope-refsect1"/><xsl:text>, "" },
    142     {   REFENTRYSTR_SCOPE_SAME,
     142    {   RTMSGREFENTRYSTR_SCOPE_SAME,
    143143        "</xsl:text><xsl:value-of select="$sTitle"/><xsl:text>" },
    144     {   REFENTRYSTR_SCOPE_SAME,
     144    {   RTMSGREFENTRYSTR_SCOPE_SAME,
    145145        "</xsl:text>
    146146        <xsl:value-of select="substring($g_sUnderlineRefSect1, 1, string-length($sTitle))"/>
     
    158158      -->
    159159    <xsl:text>
    160 static const REFENTRY </xsl:text><xsl:value-of select="$sDataBaseSym"/><xsl:text> =
     160static const RTMSGREFENTRY </xsl:text><xsl:value-of select="$sDataBaseSym"/><xsl:text> =
    161161{
    162162    /* .idInternal = */   HELP_CMD_</xsl:text>
    163     <xsl:call-template name="str:to-upper">
    164       <xsl:with-param name="text" select="translate(substring-after(@id, '-'), '-', '_')"/>
    165     </xsl:call-template>
     163    <xsl:choose>
     164      <xsl:when test="contains(@id, '-')">
     165        <xsl:call-template name="str:to-upper">   <!-- Multi level command. -->
     166          <xsl:with-param name="text" select="translate(substring-after(@id, '-'), '-', '_')"/>
     167        </xsl:call-template>
     168      </xsl:when>
     169      <xsl:otherwise>
     170        <xsl:call-template name="str:to-upper">   <!-- Simple command. -->
     171          <xsl:with-param name="text" select="@id"/>
     172        </xsl:call-template>
     173      </xsl:otherwise>
     174    </xsl:choose>
    166175    <xsl:text>,
    167176    /* .Synopsis   = */   { RT_ELEMENTS(</xsl:text>
     
    186195    <xsl:if test="text()"><xsl:message terminate="yes">cmdsynopsis with text is not supported.</xsl:message></xsl:if>
    187196    <xsl:text>
    188     {   </xsl:text><xsl:call-template name="calc-scope-cmdsynopsis"/><xsl:text> | REFENTRYSTR_FLAGS_SYNOPSIS,
     197    {   </xsl:text><xsl:call-template name="calc-scope-cmdsynopsis"/><xsl:text> | RTMSGREFENTRYSTR_FLAGS_SYNOPSIS,
    189198        "</xsl:text><xsl:call-template name="emit-indentation"/><xsl:apply-templates select="*|@*"/><xsl:text>" },</xsl:text>
    190199  </xsl:template>
     
    192201  <xsl:template match="sbr">
    193202    <xsl:text>" },
    194     {   REFENTRYSTR_SCOPE_SAME | REFENTRYSTR_FLAGS_SYNOPSIS,
     203    {   RTMSGREFENTRYSTR_SCOPE_SAME | RTMSGREFENTRYSTR_FLAGS_SYNOPSIS,
    195204        "    </xsl:text><xsl:call-template name="emit-indentation"/> <!-- hardcoded in VBoxManageHelp.cpp too -->
    196205  </xsl:template>
     
    198207  <xsl:template match="cmdsynopsis/command">
    199208    <xsl:text>" },
    200     {   REFENTRYSTR_SCOPE_SAME | REFENTRYSTR_FLAGS_SYNOPSIS,
     209    {   RTMSGREFENTRYSTR_SCOPE_SAME | RTMSGREFENTRYSTR_FLAGS_SYNOPSIS,
    201210        "</xsl:text><xsl:call-template name="emit-indentation"/>
    202211    <xsl:apply-templates select="node()|@*"/>
     
    275284    <xsl:text>
    276285    {   </xsl:text><xsl:call-template name="calc-scope-refsect2"/><xsl:text>, "" },
    277     {   REFENTRYSTR_SCOPE_SAME,
     286    {   RTMSGREFENTRYSTR_SCOPE_SAME,
    278287        "</xsl:text><xsl:call-template name="emit-indentation"/>
    279288    <xsl:value-of select="$sTitle"/>
    280289    <xsl:text>" },
    281     {   REFENTRYSTR_SCOPE_SAME,
     290    {   RTMSGREFENTRYSTR_SCOPE_SAME,
    282291        "</xsl:text><xsl:call-template name="emit-indentation"/>
    283292    <xsl:value-of select="substring($g_sUnderlineRefSect2, 1, string-length($sTitle))"/>
    284293    <xsl:text>" },
    285     {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     294    {   RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    286295
    287296    <!-- Format the text in the section -->
     
    293302    <xsl:if test="position() != last()">
    294303      <xsl:text>
    295     {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     304    {   RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    296305    </xsl:if>
    297306  </xsl:template>
     
    304313    <xsl:if test="position() != 1 or not(parent::listitem)">
    305314      <xsl:text>
    306     {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     315    {   RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    307316    </xsl:if>
    308317    <xsl:call-template name="process-mixed"/>
     
    318327    </xsl:if>
    319328    <xsl:for-each select="./varlistentry">
    320       <xsl:if test="count(*) != 2 or not(term) or not(listitem)">
    321         <xsl:message terminate="yes">Expected exactly one term and one listentry member in varlistentry element.</xsl:message>
     329      <xsl:if test="not(term) or not(listitem) or count(listitem) > 1">
     330        <xsl:message terminate="yes">Expected one or more term members and exactly one listentry member in varlistentry element.</xsl:message>
    322331      </xsl:if>
    323332      <xsl:if test="not(@spacing) or @spacing != 'compact'">
    324333        <xsl:text>
    325     {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     334    {   RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    326335      </xsl:if>
    327336      <xsl:apply-templates select="*"/>
     
    361370    <xsl:if test="position() != 1 and (not(@spacing) or @spacing != 'compact')">
    362371      <xsl:text>
    363     {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     372    {   RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    364373    </xsl:if>
    365374    <xsl:for-each select="./listitem">
     
    380389    <xsl:if test="position() != 1 and @spaceing != 'compact'">
    381390      <xsl:text>
    382     {   REFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
     391    {   RTMSGREFENTRYSTR_SCOPE_SAME, "" },</xsl:text>
    383392    </xsl:if>
    384393    <xsl:apply-templates select="*"/>
     
    395404
    396405    <xsl:text>
    397     {   REFENTRYSTR_SCOPE_SAME,
     406    {   RTMSGREFENTRYSTR_SCOPE_SAME,
    398407        "</xsl:text>
    399408
     
    426435    <xsl:if test="substring-after($sText,'&#x0a;')">
    427436      <xsl:text>" },
    428     {   REFENTRYSTR_SCOPE_SAME,
     437    {   RTMSGREFENTRYSTR_SCOPE_SAME,
    429438        "</xsl:text>
    430439      <xsl:call-template name="screen_text_line">
     
    608617  <xsl:template name="process-mixed">
    609618    <xsl:text>
    610     {   REFENTRYSTR_SCOPE_SAME,
     619    {   RTMSGREFENTRYSTR_SCOPE_SAME,
    611620        "</xsl:text><xsl:call-template name="emit-indentation"/>
    612621
     
    631640
    632641  <xsl:template name="calc-scope-for-refentry">
    633     <xsl:call-template name="calc-scope-const-from-id"/>
     642    <xsl:text>HELP_SCOPE_</xsl:text>
     643    <xsl:choose>
     644      <xsl:when test="contains(@id, '-')">          <!-- Multi level command. -->
     645        <xsl:call-template name="str:to-upper">
     646          <xsl:with-param name="text" select="translate(substring-after(@id, '-'), '-', '_')"/>
     647        </xsl:call-template>
     648      </xsl:when>
     649      <xsl:otherwise>                               <!-- Single command. -->
     650        <xsl:call-template name="str:to-upper">
     651          <xsl:with-param name="text" select="@id"/>
     652        </xsl:call-template>
     653      </xsl:otherwise>
     654    </xsl:choose>
    634655  </xsl:template>
    635656
     
    638659    <xsl:choose>
    639660      <xsl:when test="title[text() = 'Description']">
    640         <xsl:text>REFENTRYSTR_SCOPE_GLOBAL</xsl:text>
     661        <xsl:text>RTMSGREFENTRYSTR_SCOPE_GLOBAL</xsl:text>
    641662      </xsl:when>
    642663      <xsl:when test="@id or remark[@role='help-scope']">
     
    644665      </xsl:when>
    645666      <xsl:otherwise>
    646         <xsl:text>REFENTRYSTR_SCOPE_GLOBAL</xsl:text>
     667        <xsl:text>RTMSGREFENTRYSTR_SCOPE_GLOBAL</xsl:text>
    647668      </xsl:otherwise>
    648669    </xsl:choose>
     
    656677      </xsl:when>
    657678      <xsl:otherwise>
    658         <xsl:text>REFENTRYSTR_SCOPE_SAME</xsl:text>
     679        <xsl:text>RTMSGREFENTRYSTR_SCOPE_SAME</xsl:text>
    659680      </xsl:otherwise>
    660681    </xsl:choose>
     
    670691      </xsl:when>
    671692      <xsl:otherwise>
    672         <xsl:text>REFENTRYSTR_SCOPE_SAME</xsl:text>
     693        <xsl:text>RTMSGREFENTRYSTR_SCOPE_SAME</xsl:text>
    673694      </xsl:otherwise>
    674695    </xsl:choose>
     
    704725  <xsl:template name="calc-scope-const-from-id">
    705726    <xsl:param name="sId" select="@id"/>
    706     <xsl:variable name="sPrefix" select="concat(substring-before(ancestor::refentry/@id, '-'), '-')"/>
    707     <xsl:if test="not(contains($sId, sPrefix))">
    708       <xsl:message terminate="yes">Expected sId (<xsl:value-of select="$sId"/>) to contain <xsl:value-of select="$sPrefix"/></xsl:message>
    709     </xsl:if>
     727    <xsl:param name="sAncestorId" select="ancestor::refentry/@id"/>
    710728    <xsl:text>HELP_SCOPE_</xsl:text>
    711     <xsl:call-template name="str:to-upper">
    712       <xsl:with-param name="text" select="translate(substring-after($sId, $sPrefix), '-', '_')"/>
    713     </xsl:call-template>
    714   </xsl:template>
    715 
    716   <!-- Turns a remark into one or more scope constant. -->
     729    <xsl:choose>
     730      <xsl:when test="not($sAncestorId)">           <!-- Sanity check. -->
     731        <xsl:message terminate="yes">error: calc-scope-const-from-id is invoked without an refentry ancestor with a id. <xsl:call-template name="get-node-path"/> </xsl:message>
     732      </xsl:when>
     733
     734      <xsl:when test="contains($sAncestorId, '-')"> <!-- Multi level command. -->
     735        <xsl:variable name="sPrefix" select="concat(substring-before($sAncestorId, '-'), '-')"/>
     736        <xsl:if test="not(contains($sId, $sPrefix))">
     737          <xsl:message terminate="yes">Expected sId (<xsl:value-of select="$sId"/>) to contain <xsl:value-of select="$sPrefix"/></xsl:message>
     738        </xsl:if>
     739        <xsl:call-template name="str:to-upper">
     740          <xsl:with-param name="text" select="translate(substring-after($sId, $sPrefix), '-', '_')"/>
     741        </xsl:call-template>
     742      </xsl:when>
     743
     744      <xsl:otherwise>                               <!-- Single command. -->
     745        <xsl:call-template name="str:to-upper">
     746          <xsl:with-param name="text" select="translate($sId, '-', '_')"/>
     747        </xsl:call-template>
     748      </xsl:otherwise>
     749    </xsl:choose>
     750  </xsl:template>
     751
     752  <!-- Turns a remark into one or more scope constants. -->
    717753  <xsl:template name="calc-scope-consts-from-remark">
    718754    <xsl:param name="sCondition" select="remark/@condition"/>
     
    723759    <xsl:choose>
    724760      <xsl:when test="substring-before($sNormalized, ' ') = 'GLOBAL'">
    725         <xsl:text>REFENTRYSTR_SCOPE_GLOBAL</xsl:text>
     761        <xsl:text>RTMSGREFENTRYSTR_SCOPE_GLOBAL</xsl:text>
    726762      </xsl:when>
    727763      <xsl:otherwise>
     
    739775      <xsl:choose>
    740776        <xsl:when test="substring-before($sList, ' ') = 'GLOBAL'">
    741           <xsl:text>| REFENTRYSTR_SCOPE_GLOBAL</xsl:text>
     777          <xsl:text>| RTMSGREFENTRYSTR_SCOPE_GLOBAL</xsl:text>
    742778        </xsl:when>
    743779        <xsl:otherwise>
  • trunk/doc/manual/docbook-refentry-to-H-help.xsl

    r56344 r68860  
    3838    -->
    3939  <xsl:template match="refentry">
     40    <xsl:variable name="RefEntry" select="."/>
     41    <xsl:variable name="sRefEntryId" select="@id"/>
    4042    <xsl:variable name="sBaseNm">
    41       <xsl:call-template name="str:to-upper">
    42         <xsl:with-param name="text" select="translate(substring-after(@id, '-'), '-', '_')"/>
    43       </xsl:call-template>
     43      <xsl:choose>
     44        <xsl:when test="contains($sRefEntryId, '-')">   <!-- Multi level command. -->
     45          <xsl:call-template name="str:to-upper">
     46            <xsl:with-param name="text" select="translate(substring-after($sRefEntryId, '-'), '-', '_')"/>
     47          </xsl:call-template>
     48        </xsl:when>
     49        <xsl:otherwise>                                 <!-- Simple command. -->
     50          <xsl:call-template name="str:to-upper">
     51            <xsl:with-param name="text" select="translate($sRefEntryId, '-', '_')"/>
     52          </xsl:call-template>
     53        </xsl:otherwise>
     54      </xsl:choose>
    4455    </xsl:variable>
    4556
     
    4758      <!-- Generate subcommand enums and defines -->
    4859      <xsl:when test="$g_sMode = 'subcmd'">
     60        <!-- Start enum type and start off with the refentry id. -->
    4961        <xsl:text>
    5062enum
     
    5567        <xsl:text> RT_BIT_32(HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_BIT)
    5668        HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_BIT = 0</xsl:text>
    57         <xsl:for-each select="./refsynopsisdiv/cmdsynopsis">
     69
     70        <!-- Synopsis IDs -->
     71        <xsl:for-each select="./refsynopsisdiv/cmdsynopsis[@id != concat('synopsis-', $sRefEntryId)]">
    5872          <xsl:variable name="sSubNm">
    5973            <xsl:text>HELP_SCOPE_</xsl:text>
     
    6478          <xsl:text>,
    6579#define </xsl:text>
    66         <xsl:value-of select="$sSubNm"/>
    67         <xsl:value-of select="substring('                                               ',1,56 - string-length($sSubNm))"/>
    68         <xsl:text> RT_BIT_32(</xsl:text><xsl:value-of select="$sSubNm"/><xsl:text>_BIT)
    69         </xsl:text><xsl:value-of select="$sSubNm"/><xsl:text>_BIT</xsl:text>
     80          <xsl:value-of select="$sSubNm"/>
     81          <xsl:value-of select="substring('                                               ',1,56 - string-length($sSubNm))"/>
     82          <xsl:text> RT_BIT_32(</xsl:text><xsl:value-of select="$sSubNm"/><xsl:text>_BIT)
     83        </xsl:text>
     84          <xsl:value-of select="$sSubNm"/><xsl:text>_BIT</xsl:text>
    7085        </xsl:for-each>
    7186
     87        <!-- Add scoping info for refsect1, refsect2 and refsect3 IDs that aren't part of the synopsis. -->
     88        <xsl:for-each select=".//refsect1[@id] | .//refsect2[@id] | .//refsect3[@id]">
     89          <xsl:variable name="sThisId" select="@id"/>
     90          <xsl:if test="not($RefEntry[@id = $sThisId]) and not($RefEntry/refsynopsisdiv/cmdsynopsis[@id = concat('synopsis-', $sThisId)])">
     91            <xsl:variable name="sSubNm">
     92              <xsl:text>HELP_SCOPE_</xsl:text>
     93              <xsl:choose>
     94                <xsl:when test="contains($sRefEntryId, '-')">   <!-- Multi level command. -->
     95                  <xsl:call-template name="str:to-upper">
     96                    <xsl:with-param name="text" select="translate(substring-after(@id, '-'), '-', '_')"/>
     97                  </xsl:call-template>
     98                </xsl:when>
     99                <xsl:otherwise>                                 <!-- Simple command. -->
     100                  <xsl:call-template name="str:to-upper">
     101                    <xsl:with-param name="text" select="translate(@id, '-', '_')"/>
     102                  </xsl:call-template>
     103                </xsl:otherwise>
     104              </xsl:choose>
     105            </xsl:variable>
     106            <xsl:text>,
     107#define </xsl:text>
     108            <xsl:value-of select="$sSubNm"/>
     109            <xsl:value-of select="substring('                                               ',1,56 - string-length($sSubNm))"/>
     110            <xsl:text> RT_BIT_32(</xsl:text><xsl:value-of select="$sSubNm"/><xsl:text>_BIT)
     111        </xsl:text>
     112            <xsl:value-of select="$sSubNm"/><xsl:text>_BIT</xsl:text>
     113          </xsl:if>
     114        </xsl:for-each>
     115
     116        <!-- Done - complete the enum. -->
    72117        <xsl:text>,
    73     HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_END
     118        HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_END
    74119};
    75120</xsl:text>
  • trunk/doc/manual/docbook2latex.xsl

    r59523 r68860  
    582582
    583583  <xsl:template match="varlistentry">
    584     <xsl:if test="not(./term) or not(./listitem) or count(*) != 2">
    585       <xsl:message terminate="yes">Expected exactly one term and one listitem element in the varlistentry.</xsl:message>
    586     </xsl:if>
     584    <xsl:if test="not(./term) or not(./listitem) or count(./listitem) != 1">
     585      <xsl:message terminate="yes">Expected at least one term and one listitem element in the varlistentry.</xsl:message>
     586    </xsl:if>
     587    <!-- TODO: Ideally, I'd like to have each term on a new line. didn't find a simple way of doing that... -->
    587588    <xsl:text>&#x0a;&#x0a;\item[</xsl:text>
    588     <xsl:apply-templates select="term"/>
     589    <xsl:apply-templates select="./term[1]"/>
     590    <xsl:for-each select="./term[position() > 1]">
     591      <xsl:text>,&#x0a; </xsl:text>
     592      <xsl:apply-templates select="."/>
     593    </xsl:for-each>
    589594    <xsl:text>] \hfill \\&#x0a;</xsl:text>
    590595    <xsl:apply-templates select="listitem/*"/>
  • trunk/doc/manual/en_US/user_AdvancedTopics.xml

    r68829 r68860  
    43624362  </sect1>
    43634363
    4364   <sect1 id="viso">
    4365     <title>VISO file format</title>
    4366 
    4367     <para>The VISO files was introduced with VirtualBox 5.2.  They are virtual ISO images,
    4368     i.e. constructed in memory from a bunch of files on the host.  A VISO is just the
    4369     recipe describing how to go about this using a syntax vaguely similar to mkisofs and
    4370     genisoimage.</para>
    4371 
    4372     <para>One requirement, the VISO file must start with one of the
    4373     <option>--iprt-iso-maker-file-marker</option> options. Which of the options
    4374     you use will dicate the quoting and escaping rules used when reading the
    4375     file.  The option takes the image UUID as an argument.</para>
    4376 
    4377     <para>The VISO files are treated as UTF-8 and must not contain any byte order
    4378     marker (BOM).  There is currently no way to comment out lines in a VISO file.</para>
    4379 
    4380 
    4381      <xi:include href="../user_AdvancedTopics_VISO_Options.xml" xpointer="xpointer(/sect1/*)"
    4382        xmlns:xi="http://www.w3.org/2001/XInclude" />
    4383 
    4384 
    4385   </sect1>
     4364  <xi:include href="user_isomakercmd-man.xml"    xpointer="element(/1)" xmlns:xi="http://www.w3.org/2001/XInclude" />
    43864365
    43874366</chapter>
  • trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk

    r65263 r68860  
    1818SUB_DEPTH = ../../../..
    1919include $(KBUILD_PATH)/subheader.kmk
     20
     21include $(PATH_ROOT)/doc/manual/Config.kmk
     22
    2023
    2124VBOX_COMMON_VBOXMANAGE_DEFS = \
     
    6164 VBoxManage_DEFS      += $(VBOX_COMMON_VBOXMANAGE_DEFS)
    6265 VBoxManage_DEFS.win   = _WIN32_WINNT=0x0500
    63  VBoxManage_INCS       = $(PATH_TARGET)/manual
    64  VBoxManage_INTERMEDIATES = $(PATH_TARGET)/manual/VBoxManageBuiltInHelp.h
     66 VBoxManage_INCS = \
     67        $(VBoxManage_0_OUTDIR)
     68 VBoxManage_INTERMEDIATES = \
     69        $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h
    6570 VBoxManage_SOURCES    = \
    6671        VBoxManage.cpp \
     
    7681        $(if $(VBOX_WITH_GUEST_PROPS),VBoxManageGuestProp.cpp) \
    7782        VBoxManageHelp.cpp \
    78         $(PATH_TARGET)/manual/VBoxManageBuiltInHelp.cpp \
     83        $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp \
    7984        VBoxManageHostonly.cpp \
    8085        VBoxManageInfo.cpp \
     
    109114endif
    110115
     116
     117#
     118# VBoxManage built-in help from XML refentry in doc/manual/en_US/.
     119#
     120$(call KB_FN_DO_PASS0_ON_TARGET,VBoxManage)
     121
     122VBoxManage_CLEAN += \
     123        $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp \
     124        $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp.ts \
     125        $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h \
     126        $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h.ts \
     127       $(addprefix $(VBoxManage_0_OUTDIR)/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES)))
     128
     129
     130
     131# Preprocess the xml files, applying remarks.
     132$(foreach file,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
     133, $(evalcall2 def_vbox_refentry_preprocess_for_manpage,$(VBoxManage_0_OUTDIR),$(file),$(VBOX_PATH_MANUAL_SRC)/en_US/$(file)))
     134
     135
     136# Generate the .cpp file.
     137$(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp.ts \
     138+| $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp: \
     139                $(VBOX_DOCBOOK_REFENTRY_TO_C_HELP) \
     140                $(addprefix $(VBoxManage_0_OUTDIR)/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
     141                $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
     142        $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(filter %.xml,$^),$(patsubst %.ts,%,$@))
     143        $(QUIET)$(APPEND) -tn "$@" \
     144                '/* Autogenerated by $<, do not edit! */' \
     145                '' \
     146                '#include "VBoxManageBuiltInHelp.h"' \
     147                ''
     148        $(foreach refentry,$(filter %.xml,$^) \
     149        ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") $< $(refentry))
     150        $(QUIET)$(APPEND) -n "$@" \
     151        '' \
     152                'PCRTMSGREFENTRY     g_apHelpEntries[] = ' \
     153                '{'
     154        $(foreach refentry,$(filter %.xml,$^) \
     155                ,$(NLTAB)$(QUIET)$(APPEND) -n "$@" \
     156                '    &g_$(subst -,_,$(tolower $(patsubst man_%,%,$(notdir $(basename $(refentry)))))), ')
     157        $(QUIET)$(APPEND) -n "$@" \
     158                '};' \
     159                'const uint32_t g_cHelpEntries = RT_ELEMENTS(g_apHelpEntries);' \
     160               ''
     161        $(QUIET)$(CP) --changed -- "$@" "$(patsubst %.ts,%,$@)"
     162# The above APPEND stuff trigger some kind of problem on some boxes when not split up...
     163# update: Fixed in SVN (strcpy -> memmove in new_job(), job.c - r2591). Just need to rebuild all platforms.
     164
     165
     166$(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h.ts \
     167+| $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h: \
     168                $(VBOX_DOCBOOK_REFENTRY_TO_H_HELP) \
     169                $(addprefix $(VBoxManage_0_OUTDIR)/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
     170                $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
     171        $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(filter %.xml,$^),$(patsubst %.ts,%,$@))
     172        $(QUIET)$(APPEND) -tn "$@" \
     173                '/* Autogenerated by $<, do not edit! */' \
     174               '' \
     175               '#ifndef ___VBoxManageBuiltInHelp_h___' \
     176               '#define ___VBoxManageBuiltInHelp_h___' \
     177               '' \
     178               '#include <iprt/message.h>' \
     179               '' \
     180               'RT_C_DECLS_BEGIN' \
     181               '' \
     182               'typedef enum HELP_CMD_VBOXMANAGE' \
     183               '{' \
     184               '    HELP_CMD_VBOXMANAGE_INVALID = 0,'
     185        $(foreach refentry,$(filter %.xml,$^) \
     186        ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") \
     187                --stringparam 'g_sMode' 'cmd' $< $(refentry))
     188        $(QUIET)$(APPEND) -n "$@" \
     189                '    HELP_CMD_VBOXMANAGE_END' \
     190                '} HELP_CMD_VBOXMANAGE;'
     191        $(foreach refentry,$(filter %.xml,$^) \
     192        ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") \
     193                --stringparam 'g_sMode' 'subcmd' $< $(refentry))
     194        $(QUIET)$(APPEND) -n "$@" \
     195                '' \
     196                'extern PCRTMSGREFENTRY g_apHelpEntries[];' \
     197                'extern const uint32_t  g_cHelpEntries;' \
     198                '' \
     199               'RT_C_DECLS_END' \
     200                '' \
     201                '#endif' \
     202               ''
     203        $(QUIET)$(CP) --changed -- "$@" "$(patsubst %.ts,%,$@)"
     204
     205
    111206include $(FILE_KBUILD_SUB_FOOTER)
     207
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r68838 r68860  
    2828#include <iprt/getopt.h>
    2929#include <iprt/stream.h>
     30#include <iprt/message.h>
    3031
    3132#include "VBoxManage.h"
     
    4647enum HELP_CMD_VBOXMANAGE    g_enmCurCommand = HELP_CMD_VBOXMANAGE_INVALID;
    4748/** The scope maskt for the current subcommand. */
    48 uint64_t                    g_fCurSubcommandScope = REFENTRYSTR_SCOPE_GLOBAL;
     49uint64_t                    g_fCurSubcommandScope = RTMSGREFENTRYSTR_SCOPE_GLOBAL;
    4950/** String of spaces that can be used for indentation.   */
    5051static const char           g_szSpaces[] = "                                                ";
     
    6162    Assert(g_enmCurCommand == HELP_CMD_VBOXMANAGE_INVALID);
    6263    g_enmCurCommand       = enmCommand;
    63     g_fCurSubcommandScope = REFENTRYSTR_SCOPE_GLOBAL;
     64    g_fCurSubcommandScope = RTMSGREFENTRYSTR_SCOPE_GLOBAL;
    6465}
    6566
     
    7879
    7980
    80 
    81 /**
    82  * Retruns the width for the given handle.
    83  *
    84  * @returns Screen width.
    85  * @param   pStrm           The stream, g_pStdErr or g_pStdOut.
    86  */
    87 static uint32_t getScreenWidth(PRTSTREAM pStrm)
    88 {
    89     static uint32_t s_acch[2] = { 0, 0 };
    90     uint32_t        iWhich    = pStrm == g_pStdErr ? 1 : 0;
    91     uint32_t        cch       = s_acch[iWhich];
    92     if (cch)
    93         return cch;
    94 
    95     const char *psz = RTEnvGet("VBOXMANAGE_SCREEN_WIDTH");
    96     if (   !psz
    97         || RTStrToUInt32Full(psz, 0, &cch) != VINF_SUCCESS
    98         || cch == 0)
    99     {
    100         int rc = RTStrmQueryTerminalWidth(pStrm, &cch);
    101         if (rc == VERR_INVALID_FUNCTION)
    102         {
    103             /* It's not a console, but in case we're being piped to less/more/list
    104                we look for a console handle on the other standard output handle
    105                and standard input.  (Latter doesn't work on windows.)  */
    106             rc = RTStrmQueryTerminalWidth(pStrm == g_pStdErr ? g_pStdOut : g_pStdErr, &cch);
    107             if (rc == VERR_INVALID_FUNCTION || rc == VERR_INVALID_HANDLE)
    108                 rc = RTStrmQueryTerminalWidth(g_pStdIn, &cch);
    109             if (RT_FAILURE(rc))
    110                 cch = 80;
    111         }
    112     }
    113 
    114     s_acch[iWhich] = cch;
    115     return cch;
    116 }
    117 
    118 
    119 /**
    120  * Prints a string table string (paragraph), performing non-breaking-space
    121  * replacement and wrapping.
    122  *
    123  * @returns Number of lines written.
    124  * @param   pStrm           The output stream.
    125  * @param   psz             The string table string to print.
    126  * @param   cchMaxWidth     The maximum output width.
    127  * @param   fFlags          String flags that may affect formatting.
    128  */
    129 static uint32_t printString(PRTSTREAM pStrm, const char *psz, uint32_t cchMaxWidth, uint64_t fFlags)
    130 {
    131     uint32_t    cLinesWritten;
    132     size_t      cch     = strlen(psz);
    133     const char *pszNbsp = strchr(psz, REFENTRY_NBSP);
    134 
    135     /*
    136      * No-wrap case is simpler, so handle that separately.
    137      */
    138     if (cch <= cchMaxWidth)
    139     {
    140         if (!pszNbsp)
    141             RTStrmWrite(pStrm, psz, cch);
    142         else
    143         {
    144             do
    145             {
    146                 RTStrmWrite(pStrm, psz, pszNbsp - psz);
    147                 RTStrmPutCh(pStrm, ' ');
    148                 psz = pszNbsp + 1;
    149                 pszNbsp = strchr(psz, REFENTRY_NBSP);
    150             } while (pszNbsp);
    151             RTStrmWrite(pStrm, psz, strlen(psz));
    152         }
    153         RTStrmPutCh(pStrm, '\n');
    154         cLinesWritten = 1;
    155     }
    156     /*
    157      * We need to wrap stuff, too bad.
    158      */
    159     else
    160     {
    161         /* Figure the paragraph indent level first. */
    162         uint32_t cchIndent = 0;
    163         while (*psz == ' ')
    164             cchIndent++, psz++;
    165         Assert(cchIndent + 4 + 1 <= RT_ELEMENTS(g_szSpaces));
    166 
    167         if (cchIndent + 8 >= cchMaxWidth)
    168             cchMaxWidth += cchIndent + 8;
    169 
    170         /* Work our way thru the string, line by line. */
    171         uint32_t cchHangingIndent = 0;
    172         cLinesWritten = 0;
    173         do
    174         {
    175             RTStrmWrite(pStrm, g_szSpaces, cchIndent + cchHangingIndent);
    176             size_t  offLine       = cchIndent + cchHangingIndent;
    177             bool    fPendingSpace = false;
    178             do
    179             {
    180                 const char *pszSpace = strchr(psz, ' ');
    181                 size_t      cchWord  = pszSpace ? pszSpace - psz : strlen(psz);
    182                 if (   offLine + cchWord + fPendingSpace > cchMaxWidth
    183                     && offLine != cchIndent
    184                     && fPendingSpace /* don't stop before first word */)
    185                     break;
    186 
    187                 pszNbsp = (const char *)memchr(psz, REFENTRY_NBSP, cchWord);
    188                 while (pszNbsp)
    189                 {
    190                     size_t cchSubWord = pszNbsp - psz;
    191                     if (fPendingSpace)
    192                         RTStrmPutCh(pStrm, ' ');
    193                     RTStrmWrite(pStrm, psz, cchSubWord);
    194                     offLine += cchSubWord + fPendingSpace;
    195                     psz     += cchSubWord + 1;
    196                     cchWord -= cchSubWord + 1;
    197                     pszNbsp = (const char *)memchr(psz, REFENTRY_NBSP, cchWord);
    198                     fPendingSpace = true;
    199                 }
    200 
    201                 if (fPendingSpace)
    202                     RTStrmPutCh(pStrm, ' ');
    203                 RTStrmWrite(pStrm, psz, cchWord);
    204                 offLine += cchWord + fPendingSpace;
    205                 psz      = pszSpace ? pszSpace + 1 : strchr(psz, '\0');
    206                 fPendingSpace = true;
    207             } while (offLine < cchMaxWidth && *psz != '\0');
    208             RTStrmPutCh(pStrm, '\n');
    209             cLinesWritten++;
    210 
    211             /* Set up hanging indent if relevant. */
    212             if (fFlags & REFENTRYSTR_FLAGS_SYNOPSIS)
    213                 cchHangingIndent = 4;
    214         } while (*psz != '\0');
    215     }
    216     return cLinesWritten;
    217 }
    218 
    219 
    220 /**
    221  * Checks if the given string is empty (only spaces).
    222  * @returns true if empty, false if not.
    223  * @param   psz                 The string to examine.
    224  */
    225 DECLINLINE(bool) isEmptyString(const char *psz)
    226 {
    227     char ch;
    228     while ((ch = *psz) == ' ')
    229         psz++;
    230     return ch == '\0';
    231 }
    232 
    233 
    234 /**
    235  * Prints a string table.
    236  *
    237  * @returns Current number of pending blank lines.
    238  * @param   pStrm               The output stream.
    239  * @param   pStrTab             The string table.
    240  * @param   fScope              The selection scope.
    241  * @param   cPendingBlankLines  Pending blank lines from previous string table.
    242  * @param   pcLinesWritten      Pointer to variable that should be incremented
    243  *                              by the number of lines written.  Optional.
    244  */
    245 static uint32_t printStringTable(PRTSTREAM pStrm, PCREFENTRYSTRTAB pStrTab, uint64_t fScope, uint32_t cPendingBlankLines,
    246                                  uint32_t *pcLinesWritten = NULL)
    247 {
    248     uint32_t cLinesWritten = 0;
    249     uint32_t cchWidth      = getScreenWidth(pStrm);
    250     uint64_t fPrevScope    = fScope;
    251     for (uint32_t i = 0; i < pStrTab->cStrings; i++)
    252     {
    253         uint64_t fCurScope = pStrTab->paStrings[i].fScope;
    254         if ((fCurScope & REFENTRYSTR_SCOPE_MASK) == REFENTRYSTR_SCOPE_SAME)
    255         {
    256             fCurScope &= ~REFENTRYSTR_SCOPE_MASK;
    257             fCurScope |= (fPrevScope & REFENTRYSTR_SCOPE_MASK);
    258         }
    259         if (fCurScope & REFENTRYSTR_SCOPE_MASK & fScope)
    260         {
    261             const char *psz = pStrTab->paStrings[i].psz;
    262             if (psz && !isEmptyString(psz))
    263             {
    264                 while (cPendingBlankLines > 0)
    265                 {
    266                     cPendingBlankLines--;
    267                     RTStrmPutCh(pStrm, '\n');
    268                     cLinesWritten++;
    269                 }
    270                 cLinesWritten += printString(pStrm, psz, cchWidth, fCurScope & REFENTRYSTR_FLAGS_MASK);
    271             }
    272             else
    273                 cPendingBlankLines++;
    274         }
    275         fPrevScope = fCurScope;
    276     }
    277 
    278     if (pcLinesWritten)
    279         *pcLinesWritten += cLinesWritten;
    280     return cPendingBlankLines;
    281 }
    28281
    28382
     
    29897    for (uint32_t i = 0; i < g_cHelpEntries; i++)
    29998    {
    300         PCREFENTRY pHelp = g_apHelpEntries[i];
     99        PCRTMSGREFENTRY pHelp = g_apHelpEntries[i];
    301100        if (pHelp->idInternal == (int64_t)enmCommand)
    302101        {
     
    304103            if (cFound == 1)
    305104            {
    306                 if (fSubcommandScope == REFENTRYSTR_SCOPE_GLOBAL)
     105                if (fSubcommandScope == RTMSGREFENTRYSTR_SCOPE_GLOBAL)
    307106                    RTStrmPrintf(pStrm, "Usage - %c%s:\n", RT_C_TO_UPPER(pHelp->pszBrief[0]), pHelp->pszBrief + 1);
    308107                else
    309108                    RTStrmPrintf(pStrm, "Usage:\n");
    310109            }
    311             cPendingBlankLines = printStringTable(pStrm, &pHelp->Synopsis, fSubcommandScope, cPendingBlankLines, &cLinesWritten);
     110            RTMsgRefEntryPrintStringTable(pStrm, &pHelp->Synopsis, fSubcommandScope, &cPendingBlankLines, &cLinesWritten);
    312111            if (!cPendingBlankLines)
    313112                cPendingBlankLines = 1;
     
    344143    for (uint32_t i = 0; i < g_cHelpEntries; i++)
    345144    {
    346         PCREFENTRY pHelp = g_apHelpEntries[i];
     145        PCRTMSGREFENTRY pHelp = g_apHelpEntries[i];
    347146        if (   pHelp->idInternal == (int64_t)enmCommand
    348147            || enmCommand == HELP_CMD_VBOXMANAGE_INVALID)
    349148        {
    350149            cFound++;
    351             cPendingBlankLines = printStringTable(pStrm, &pHelp->Help, fSubcommandScope, cPendingBlankLines);
     150            RTMsgRefEntryPrintStringTable(pStrm, &pHelp->Help, fSubcommandScope, &cPendingBlankLines, NULL /*pcLinesWritten*/);
    352151            if (cPendingBlankLines < 2)
    353152                cPendingBlankLines = 2;
     
    377176{
    378177    Assert(g_enmCurCommand != HELP_CMD_VBOXMANAGE_INVALID);
    379     Assert(g_fCurSubcommandScope == REFENTRYSTR_SCOPE_GLOBAL);
     178    Assert(g_fCurSubcommandScope == RTMSGREFENTRYSTR_SCOPE_GLOBAL);
    380179
    381180    return errorSyntax("No subcommand specified");
     
    394193{
    395194    Assert(g_enmCurCommand != HELP_CMD_VBOXMANAGE_INVALID);
    396     Assert(g_fCurSubcommandScope == REFENTRYSTR_SCOPE_GLOBAL);
     195    Assert(g_fCurSubcommandScope == RTMSGREFENTRYSTR_SCOPE_GLOBAL);
    397196
    398197    /* check if help was requested. */
     
    421220{
    422221    Assert(g_enmCurCommand != HELP_CMD_VBOXMANAGE_INVALID);
    423     Assert(g_fCurSubcommandScope != REFENTRYSTR_SCOPE_GLOBAL);
     222    Assert(g_fCurSubcommandScope != RTMSGREFENTRYSTR_SCOPE_GLOBAL);
    424223
    425224    /* check if help was requested. */
     
    14071206        for (uint32_t i = 0; i < g_cHelpEntries; i++)
    14081207        {
    1409             PCREFENTRY pHelp = g_apHelpEntries[i];
     1208            PCRTMSGREFENTRY pHelp = g_apHelpEntries[i];
    14101209            while (cPendingBlankLines-- > 0)
    14111210                RTStrmPutCh(pStrm, '\n');
    14121211            RTStrmPrintf(pStrm, " %c%s:\n", RT_C_TO_UPPER(pHelp->pszBrief[0]), pHelp->pszBrief + 1);
    1413             cPendingBlankLines = printStringTable(pStrm, &pHelp->Synopsis, REFENTRYSTR_SCOPE_GLOBAL, 0);
     1212            cPendingBlankLines = 0;
     1213            RTMsgRefEntryPrintStringTable(pStrm, &pHelp->Synopsis, RTMSGREFENTRYSTR_SCOPE_GLOBAL,
     1214                                          &cPendingBlankLines, NULL /*pcLinesWritten*/);
    14141215            cPendingBlankLines = RT_MAX(cPendingBlankLines, 1);
    14151216        }
  • trunk/src/VBox/Runtime/Makefile.kmk

    r68830 r68860  
    474474        common/misc/lockvalidator.cpp \
    475475        common/misc/message.cpp \
     476        common/misc/messagerefentry.cpp \
    476477        common/misc/once.cpp \
    477478        common/misc/req.cpp \
     
    14351436
    14361437#
     1438# Generate RTIsoMaker / VISO help text from the manpage xml.
     1439#
     1440IPRT_XML_REFENTRY_FILES = \
     1441        common/fs/isomakercmd-man.xml
     1442
     1443#$(call KB_FN_DO_PASS0_ON_TARGET,RuntimeR3)
     1444
     1445BLDDIRS += $(IPRT_OUT_DIR)/man/
     1446OTHER_CLEAN += \
     1447        $(addprefix $(IPRT_OUT_DIR)/man/,$(IPRT_XML_REFENTRY_FILES)) \
     1448        $(addprefix $(IPRT_OUT_DIR)/man/,$(patsubst %.xml,%.h,$(IPRT_XML_REFENTRY_FILES))) \
     1449        $(addprefix $(IPRT_OUT_DIR)/man/,$(patsubst %.xml,%.h.ts,$(IPRT_XML_REFENTRY_FILES)))
     1450
     1451
     1452include $(PATH_ROOT)/doc/manual/Config.kmk
     1453
     1454# Preprocess the xml files, applying remarks.
     1455$(foreach file,$(IPRT_XML_REFENTRY_FILES) \
     1456, $(evalcall2 def_vbox_refentry_preprocess_for_manpage,$(IPRT_OUT_DIR)/man,$(notdir $(file)),$(VBOX_PATH_RUNTIME_SRC)/$(file)))
     1457
     1458# generate the header and add it as a dependency to the source using it.
     1459$(evalcall2 def_vbox_single_refentry_to_h,$(IPRT_OUT_DIR)/man/isomakercmd-man.h, $(IPRT_OUT_DIR)/man/isomakercmd-man.xml)
     1460common/fs/isomakercmd.cpp_DEPS = $(IPRT_OUT_DIR)/man/isomakercmd-man.h
     1461common/fs/isomakercmd.cpp_INCS = $(IPRT_OUT_DIR)/man/
     1462
     1463foobar: $(IPRT_OUT_DIR)/isomakercmd-man.h.ts
     1464
     1465
     1466
     1467#
    14371468# RuntimeBldProg - Static Runtime for build programs.
    14381469#
  • trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp

    r68842 r68860  
    667667};
    668668
     669#include "isomakercmd-man.h"
     670
    669671
    670672/*********************************************************************************************************************************
     
    810812static void rtFsIsoMakerCmdUsage(PRTFSISOMAKERCMDOPTS pOpts, const char *pszProgName)
    811813{
     814#if 0
    812815    rtFsIsoMakerPrintf(pOpts,
    813816                       "Usage: %s [options] [@commands.rsp] <filespec1> [filespec2 [..]]\n"
     
    11321135                       "\n"
    11331136                       , RTPathFilename(pszProgName));
    1134 
    1135 
     1137#else
     1138    if (pOpts->pErrInfo)
     1139        rtFsIsoMakerPrintf(pOpts, "Usage: %s [options] [@commands.rsp] <filespec1> [filespec2 [..]]\n",
     1140                           RTPathFilename(pszProgName));
     1141    else
     1142        RTMsgRefEntryHelp(g_pStdOut, &g_rtisomaker);
     1143#endif
    11361144}
    11371145
Note: See TracChangeset for help on using the changeset viewer.

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