VirtualBox

Changeset 81137 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Oct 8, 2019 8:28:31 AM (5 years ago)
Author:
vboxsync
Message:

IPRT/RTSystem*Firmware: Simplified the interface and made it follow the style of the rest of RTSystemQuery*. Added RTSystemFirmwareTypeName() to avoid duplicating enum->string code over and over again.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r81071 r81137  
    22212221# define RTSymlinkRead                                  RT_MANGLER(RTSymlinkRead)
    22222222# define RTSymlinkReadA                                 RT_MANGLER(RTSymlinkReadA)
    2223 # define RTSystemFirmwareQueryType                      RT_MANGLER(RTSystemFirmwareQueryType)
    2224 # define RTSystemFirmwareQueryValue                     RT_MANGLER(RTSystemFirmwareQueryValue)
    2225 # define RTSystemFirmwareFreeValue                      RT_MANGLER(RTSystemFirmwareFreeValue)
     2223# define RTSystemQueryFirmwareType                      RT_MANGLER(RTSystemQueryFirmwareType)
     2224# define RTSystemQueryFirmwareBoolean                   RT_MANGLER(RTSystemQueryFirmwareBoolean)
     2225# define RTSystemFirmwareTypeName                       RT_MANGLER(RTSystemFirmwareTypeName)
    22262226# define RTSystemIsInsideVM                             RT_MANGLER(RTSystemIsInsideVM)
    22272227# define RTSystemQueryAvailableRam                      RT_MANGLER(RTSystemQueryAvailableRam)
  • trunk/include/iprt/system.h

    r81066 r81137  
    288288 * @param   penmType    Where to return the firmware type on success.
    289289 */
    290 RTDECL(int) RTSystemFirmwareQueryType(PRTSYSFWTYPE penmType);
    291 
    292 /**
    293  * Enumeration for defining a system firmware value type.
    294  */
    295 typedef enum RTSYSFWVALUETYPE
    296 {
    297     /** Invalid value type. */
    298     RTSYSFWVALUETYPE_INVALID = 0,
    299     /** Value is of type boolean. */
    300     RTSYSFWVALUETYPE_BOOLEAN,
    301     /** The usual 32-bit hack.  */
    302     RTSYSFWVALUETYPE_32_BIT_HACK = 0x7fffffff
    303 } RTSYSFWVALUETYPE;
    304 
    305 /**
    306  * Structure for keeping a system firmware value.
    307  */
    308 typedef struct RTSYSFWVALUE
    309 {
    310     /** Value type. */
    311     RTSYSFWVALUETYPE enmType;
    312     union
    313     {
    314         /** Boolean value. */
    315         bool fVal;
    316     } u;
    317 } RTSYSFWVALUE;
    318 /** Pointer to a system firmware value. */
    319 typedef RTSYSFWVALUE *PRTSYSFWVALUE;
     290RTDECL(int) RTSystemQueryFirmwareType(PRTSYSFWTYPE penmType);
     291
     292/**
     293 * Translates the @a enmType value to a string.
     294 *
     295 * @returns Read-only name.
     296 * @param   enmType     The firmware type to convert to string.
     297 */
     298RTDECL(const char *) RTSystemFirmwareTypeName(RTSYSFWTYPE enmType);
    320299
    321300/**
     
    342321 *          supported.
    343322 * @param   enmProp     The property to query the value of.
    344  * @param   pValue      Where to return the value.  This is always zero'ed.
    345  */
    346 RTDECL(int) RTSystemFirmwareQueryValue(RTSYSFWPROP enmProp, PRTSYSFWVALUE pValue);
    347 
    348 /**
    349  * Free any allocations associated with a value returned by
    350  * RTSystemFirmwareQueryValue().
    351  *
    352  * @param   pValue  Result of a successful RTSystemFirmwareQueryValue() call.
    353  */
    354 RTDECL(void) RTSystemFirmwareFreeValue(PRTSYSFWVALUE pValue);
     323 * @param   pfValue     Where to return the value.
     324 */
     325RTDECL(int) RTSystemQueryFirmwareBoolean(RTSYSFWPROP enmProp, bool *pfValue);
    355326
    356327#ifdef RT_OS_WINDOWS
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