VirtualBox

Changeset 68861 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Sep 25, 2017 8:04:20 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/include/iprt
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r68836 r68861  
    14211421# define RTMsgWarning                                   RT_MANGLER(RTMsgWarning)
    14221422# define RTMsgWarningV                                  RT_MANGLER(RTMsgWarningV)
     1423# define RTMsgRefEntryPrintStringTable                  RT_MANGLER(RTMsgRefEntryPrintStringTable)
     1424# define RTMsgRefEntrySynopsisEx                        RT_MANGLER(RTMsgRefEntrySynopsisEx)
     1425# define RTMsgRefEntrySynopsis                          RT_MANGLER(RTMsgRefEntrySynopsis)
     1426# define RTMsgRefEntryHelpEx                            RT_MANGLER(RTMsgRefEntryHelpEx)
     1427# define RTMsgRefEntryHelp                              RT_MANGLER(RTMsgRefEntryHelp)
    14231428# define RTNetIPv4AddDataChecksum                       RT_MANGLER(RTNetIPv4AddDataChecksum)
    14241429# define RTNetIPv4AddTCPChecksum                        RT_MANGLER(RTNetIPv4AddTCPChecksum)
  • trunk/include/iprt/message.h

    r66780 r68861  
    209209RTDECL(int)  RTMsgInfoV(const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(1, 0);
    210210
     211
     212
     213/** @defgroup grp_rt_msg_refentry Help generated from refentry/manpage.
     214 *
     215 * The refentry/manpage docbook source in doc/manual/en_US/man_* is processed by
     216 * doc/manual/docbook-refentry-to-C-help.xsl and turned a set of the structures
     217 * defined here.
     218 *
     219 * @{
     220 */
     221
     222/** The non-breaking space character.
     223 * @remarks We could've used U+00A0, but it is easier both to encode and to
     224 *          search and replace a single ASCII character. */
     225#define RTMSGREFENTRY_NBSP              '\b'
     226
     227/** @name REFENTRYSTR_SCOPE_XXX - Common string scoping and flags.
     228 * @{ */
     229/** Same scope as previous string table entry, flags are reset and can be
     230 *  ORed in. */
     231#define RTMSGREFENTRYSTR_SCOPE_SAME     UINT64_C(0)
     232/** Global scope. */
     233#define RTMSGREFENTRYSTR_SCOPE_GLOBAL   UINT64_C(0x00ffffffffffffff)
     234/** Scope mask. */
     235#define RTMSGREFENTRYSTR_SCOPE_MASK     UINT64_C(0x00ffffffffffffff)
     236/** Flags mask. */
     237#define RTMSGREFENTRYSTR_FLAGS_MASK     UINT64_C(0xff00000000000000)
     238/** Command synopsis, special hanging indent rules applies. */
     239#define RTMSGREFENTRYSTR_FLAGS_SYNOPSIS RT_BIT_64(63)
    211240/** @} */
    212241
     242/** String table entry for a refentry. */
     243typedef struct RTMSGREFENTRYSTR
     244{
     245    /** The scope of the string.  There are two predefined scopes,
     246     *  REFENTRYSTR_SCOPE_SAME and REFENTRYSTR_SCOPE_GLOBAL.  The rest are
     247     *  reference entry specific. */
     248    uint64_t        fScope;
     249    /** The string.  Non-breaking space is represented by the char
     250     * REFENTRY_NBSP defines, just in case the string needs wrapping.  There is
     251     * no trailing newline, that's implicit. */
     252    const char     *psz;
     253} RTMSGREFENTRYSTR;
     254/** Pointer to a read-only string table entry. */
     255typedef const RTMSGREFENTRYSTR *PCRTMSGREFENTRYSTR;
     256
     257/** Refentry string table. */
     258typedef struct RTMSGREFENTRYSTRTAB
     259{
     260    /** Number of strings. */
     261    uint16_t            cStrings;
     262    /** Reserved for future use. */
     263    uint16_t            fReserved;
     264    /** Pointer to the string table. */
     265    PCRTMSGREFENTRYSTR  paStrings;
     266} RTMSGREFENTRYSTRTAB;
     267/** Pointer to a read-only string table. */
     268typedef RTMSGREFENTRYSTRTAB const *PCRTMSGREFENTRYSTRTAB;
     269
     270/**
     271 * Help extracted from a docbook refentry document.
     272 */
     273typedef struct RTMSGREFENTRY
     274{
     275    /** Internal reference entry identifier.  */
     276    int64_t             idInternal;
     277    /** Usage synopsis. */
     278    RTMSGREFENTRYSTRTAB Synopsis;
     279    /** Full help. */
     280    RTMSGREFENTRYSTRTAB Help;
     281    /** Brief command description. */
     282    const char         *pszBrief;
     283} RTMSGREFENTRY;
     284/** Pointer to a read-only refentry help extract structure. */
     285typedef RTMSGREFENTRY const *PCRTMSGREFENTRY;
     286
     287
     288typedef struct RTSTREAM *PRTSTREAM;
     289
     290RTDECL(int) RTMsgRefEntrySynopsisEx(PRTSTREAM pStrm, PCRTMSGREFENTRY pEntry, uint64_t fScope, uint32_t fFlags);
     291/** @name  RTMSGREFENTRY_SYNOPSIS_F_XXX -  Flags for RTMsgRefEntrySynopsisEx.
     292 * @{  */
     293/** Prefix the output with 'Usage:'.   */
     294#define RTMSGREFENTRY_SYNOPSIS_F_USAGE      RT_BIT_32(0)
     295/** @}  */
     296
     297RTDECL(int) RTMsgRefEntrySynopsis(PRTSTREAM pStrm, PCRTMSGREFENTRY pEntry);
     298
     299RTDECL(int) RTMsgRefEntryHelpEx(PRTSTREAM pStrm, PCRTMSGREFENTRY pEntry, uint64_t fScope, uint32_t fFlags);
     300RTDECL(int) RTMsgRefEntryHelp(PRTSTREAM pStrm, PCRTMSGREFENTRY pEntry);
     301RTDECL(int) RTMsgRefEntryPrintStringTable(PRTSTREAM pStrm, PCRTMSGREFENTRYSTRTAB pStrTab, uint64_t fScope,
     302                                          uint32_t *pcPendingBlankLines, uint32_t *pcLinesWritten);
     303
     304/** @} */
     305
     306
     307/** @} */
     308
    213309RT_C_DECLS_END
    214310
  • trunk/include/iprt/refentry.h

    r68830 r68861  
    1 /** @file
    2  * VirtualBox - manpage/refentry C extracts for built-in help.
    3  */
    41
    5 /*
    6  * Copyright (C) 2015-2016 Oracle Corporation
    7  *
    8  * This file is part of VirtualBox Open Source Edition (OSE), as
    9  * available from http://www.virtualbox.org. This file is free software;
    10  * you can redistribute it and/or modify it under the terms of the GNU
    11  * General Public License (GPL) as published by the Free Software
    12  * Foundation, in version 2 as it comes in the "COPYING" file of the
    13  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
    14  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    15  *
    16  * The contents of this file may alternatively be used under the terms
    17  * of the Common Development and Distribution License Version 1.0
    18  * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
    19  * VirtualBox OSE distribution, in which case the provisions of the
    20  * CDDL are applicable instead of those of the GPL.
    21  *
    22  * You may elect to license modified versions of this file under the
    23  * terms and conditions of either the GPL or the CDDL or both.
    24  */
    25 
    26 #ifndef ___VBox_refentry_h
    27 #define ___VBox_refentry_h
    28 
    29 #include <iprt/types.h>
    30 
    31 /** @defgroup grp_refentry Help generated from refentry/manpage.
    32  *
    33  * The refentry/manpage docbook source in doc/manual/en_US/man_* is processed by
    34  * doc/manual/docbook-refentry-to-C-help.xsl and turned a set of the structures
    35  * defined here.
    36  *
    37  * @{
    38  */
    39 
    40 /** The non-breaking space character.
    41  * @remarks We could've used U+00A0, but it is easier both to encode and to
    42  *          search and replace a single ASCII character. */
    43 #define REFENTRY_NBSP               '\b'
    44 
    45 /** @name REFENTRYSTR_SCOPE_XXX - Common string scoping and flags.
    46  * @{ */
    47 /** Same scope as previous string table entry, flags are reset and can be
    48  *  ORed in. */
    49 #define REFENTRYSTR_SCOPE_SAME      UINT64_C(0)
    50 /** Global scope. */
    51 #define REFENTRYSTR_SCOPE_GLOBAL    UINT64_C(0x00ffffffffffffff)
    52 /** Scope mask. */
    53 #define REFENTRYSTR_SCOPE_MASK      UINT64_C(0x00ffffffffffffff)
    54 /** Flags mask. */
    55 #define REFENTRYSTR_FLAGS_MASK      UINT64_C(0xff00000000000000)
    56 /** Command synopsis, special hanging indent rules applies. */
    57 #define REFENTRYSTR_FLAGS_SYNOPSIS  RT_BIT_64(63)
    58 /** @} */
    59 
    60 /** String table entry for a re.   */
    61 typedef struct REFENTRYSTR
    62 {
    63     /** The scope of the string.  There are two predefined scopes,
    64      *  REFENTRYSTR_SCOPE_SAME and REFENTRYSTR_SCOPE_GLOBAL.  The rest are
    65      *  reference entry specific. */
    66     uint64_t        fScope;
    67     /** The string.  Non-breaking space is represented by the char
    68      * REFENTRY_NBSP defines, just in case the string needs wrapping.  There is
    69      * no trailing newline, that's implicit. */
    70     const char     *psz;
    71 } REFENTRYSTR;
    72 /** Pointer to a read-only string table entry. */
    73 typedef const REFENTRYSTR *PCREFENTRYSTR;
    74 
    75 typedef struct REFENTRYSTRTAB
    76 {
    77     /** Number of strings. */
    78     uint16_t        cStrings;
    79     /** Reserved for future use. */
    80     uint16_t        fReserved;
    81     /** Pointer to the string table. */
    82     PCREFENTRYSTR   paStrings;
    83 } REFENTRYSTRTAB;
    84 /** Pointer to a read-only string table. */
    85 typedef REFENTRYSTRTAB const *PCREFENTRYSTRTAB;
    86 
    87 /**
    88  * Help extracted from a docbook refentry document.
    89  */
    90 typedef struct REFENTRY
    91 {
    92     /** Internal reference entry identifier.  */
    93     int64_t        idInternal;
    94     /** Usage synopsis. */
    95     REFENTRYSTRTAB Synopsis;
    96     /** Full help. */
    97     REFENTRYSTRTAB Help;
    98     /** Brief command description. */
    99     const char    *pszBrief;
    100 } REFENTRY;
    101 /** Pointer to a read-only refentry help extract structure. */
    102 typedef REFENTRY const *PCREFENTRY;
    103 
    104 /** @} */
    105 
    106 #endif
    107 
  • trunk/include/iprt/stream.h

    r68836 r68861  
    256256 * @param   pStream         The stream.
    257257 * @param   pszString       The string to write.
    258  *                          No newlines or anything is appended or prepended.
     258 *                          No newlines or anything are appended or prepended.
    259259 *                          The terminating '\\0' is not written, of course.
    260260 */
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