VirtualBox

Changeset 37244 in vbox


Ignore:
Timestamp:
May 30, 2011 8:28:07 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
71966
Message:

Main/VirtualBox: new method for querying the API version

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r37240 r37244  
    10601060# Changed with every new version, so beware!
    10611061if $(VBOX_VERSION_BUILD) < 51
    1062   VBOX_API_SUFFIX              = _$(VBOX_VERSION_MAJOR)_$(VBOX_VERSION_MINOR)
     1062  VBOX_API_VERSION          = $(VBOX_VERSION_MAJOR)_$(VBOX_VERSION_MINOR)
    10631063else
    1064   VBOX_API_SUFFIX              = _$(VBOX_VERSION_MAJOR)_$(expr $(VBOX_VERSION_MINOR) + 1)
    1065 endif
    1066 VBOX_JAVA_PACKAGE             = org.virtualbox$(VBOX_API_SUFFIX)
     1064  VBOX_API_VERSION          = $(VBOX_VERSION_MAJOR)_$(expr $(VBOX_VERSION_MINOR) + 1)
     1065endif
     1066VBOX_API_SUFFIX             = _$(VBOX_API_VERSION)
     1067VBOX_JAVA_PACKAGE           = org.virtualbox$(VBOX_API_SUFFIX)
    10671068
    10681069#
     
    46384639#
    46394640VBOX_BAD_CHAR_SET   = ,;:/\$(SP)$(TAB)$(HASH)=![]@%&''()*""<>?^{}|~
    4640 VBOX_VERSION_STAMP  = $(PATH_OUT)/version-stamp-raw-$(translate $(VBOX_VERSION_STRING)-$(VBOX_C_YEAR)-$(VBOX_VENDOR)-$(VBOX_PRODUCT),$(VBOX_BAD_CHAR_SET),,_)
     4641VBOX_VERSION_STAMP  = $(PATH_OUT)/version-stamp-raw-api-$(translate $(VBOX_VERSION_STRING)-$(VBOX_C_YEAR)-$(VBOX_VENDOR)-$(VBOX_PRODUCT)-$(VBOX_API_VERSION),$(VBOX_BAD_CHAR_SET),,_)
    46414642VBOX_VERSION_HEADER = $(PATH_OUT)/version-generated.h
    46424643VBOX_VERSION_MK     = $(PATH_OUT)/version-generated.mk
     
    46604661        $(QUIET)$(APPEND) [email protected] '#define VBOX_VERSION_STRING_RAW "$(VBOX_VERSION_STRING_RAW)"'
    46614662        $(QUIET)$(APPEND) [email protected] '#define VBOX_VERSION_STRING "$(VBOX_VERSION_STRING)"'
     4663        $(QUIET)$(APPEND) [email protected] '#define VBOX_API_VERSION_STRING "$(VBOX_API_VERSION)"'
    46624664        $(QUIET)$(APPEND) [email protected] ''
    46634665        $(QUIET)$(APPEND) [email protected] '#endif'
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp

    r35801 r37244  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    832832            ULONG ulValue;
    833833            LONG64 i64Value;
     834
     835            rptrVirtualBox->COMGETTER(APIVersion)(str.asOutParam());
     836            RTPrintf("API version:                     %ls\n", str.raw());
    834837
    835838            systemProperties->COMGETTER(MinGuestRAM)(&ulValue);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r37200 r37244  
    13921392  <interface
    13931393    name="IVirtualBox" extends="$unknown"
    1394     uuid="d2de270c-1d4b-4c9e-843f-bbb9b47269ff"
     1394    uuid="bc166b9b-9b62-4145-b1f6-6c39068aaf00"
    13951395    wsmap="managed"
    13961396    >
     
    14311431        is either GENERIC, UBUNTU_606, UBUNTU_710, or something like
    14321432        this.
     1433      </desc>
     1434    </attribute>
     1435
     1436    <attribute name="APIVersion" type="wstring" readonly="yes">
     1437      <desc>
     1438        A string representing the VirtualBox API version number. The format is
     1439        2 integer numbers divided by an underscore (e.g. 1_0). After the
     1440        first public release of packages with a particular API version the
     1441        API will not be changed in an incompatible way. Note that this
     1442        guarantee does not apply to development builds, and also there is no
     1443        guarantee that this version is identical to the first two integer
     1444        numbers of the package version.
    14331445      </desc>
    14341446    </attribute>
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r35903 r37244  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    104104    STDMETHOD(COMGETTER(Revision))              (ULONG *aRevision);
    105105    STDMETHOD(COMGETTER(PackageType))           (BSTR *aPackageType);
     106    STDMETHOD(COMGETTER(APIVersion))            (BSTR *aAPIVersion);
    106107    STDMETHOD(COMGETTER(HomeFolder))            (BSTR *aHomeFolder);
    107108    STDMETHOD(COMGETTER(SettingsFilePath))      (BSTR *aSettingsFilePath);
     
    313314    static ULONG sRevision;
    314315    static Bstr sPackageType;
     316    static Bstr sAPIVersion;
    315317
    316318    static DECLCALLBACK(int) ClientWatcher (RTTHREAD thread, void *pvUser);
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r36617 r37244  
    66
    77/*
    8  * Copyright (C) 2006-2010 Oracle Corporation
     8 * Copyright (C) 2006-2011 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    104104Bstr VirtualBox::sPackageType;
    105105
     106// static
     107Bstr VirtualBox::sAPIVersion;
     108
    106109////////////////////////////////////////////////////////////////////////////////
    107110//
     
    390393    if (sPackageType.isEmpty())
    391394        sPackageType = VBOX_PACKAGE_STRING;
    392     LogFlowThisFunc(("Version: %ls, Package: %ls\n", sVersion.raw(), sPackageType.raw()));
     395    if (sAPIVersion.isEmpty())
     396        sAPIVersion = VBOX_API_VERSION_STRING;
     397    LogFlowThisFunc(("Version: %ls, Package: %ls, API Version: %ls\n", sVersion.raw(), sPackageType.raw(), sAPIVersion.raw()));
    393398
    394399    /* Get the VirtualBox home directory. */
     
    885890
    886891    sPackageType.cloneTo(aPackageType);
     892    return S_OK;
     893}
     894
     895STDMETHODIMP VirtualBox::COMGETTER(APIVersion)(BSTR *aAPIVersion)
     896{
     897    CheckComArgNotNull(aAPIVersion);
     898
     899    AutoCaller autoCaller(this);
     900    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     901
     902    sAPIVersion.cloneTo(aAPIVersion);
    887903    return S_OK;
    888904}
Note: See TracChangeset for help on using the changeset viewer.

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