VirtualBox

Changeset 68861 in vbox for trunk/include/iprt/refentry.h


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).

File:
1 moved

Legend:

Unmodified
Added
Removed
  • 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 
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