VirtualBox

Changeset 32207 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 2, 2010 2:22:54 PM (14 years ago)
Author:
vboxsync
Message:

VBoxControl: Stubbed a bunch of new commands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp

    r32205 r32207  
    8282    GUEST_SHAREDFOLDERS,
    8383#endif
     84    TAKE_SNAPSHOT,
     85    SAVE_STATE,
     86    SUSPEND,
     87    POWER_OFF,
     88    VERSION,
     89    HELP,
    8490    USAGE_ALL = UINT32_MAX
    8591};
     
    95101 * them can fix this. */
    96102#if defined(RT_OS_WINDOWS) && !defined(VBOX_CONTROL_TEST)
    97     if ((GET_VIDEO_ACCEL == eWhich) || (USAGE_ALL == eWhich))
     103    if (GET_VIDEO_ACCEL == eWhich || eWhich == USAGE_ALL)
    98104        doUsage("", g_pszProgName, "getvideoacceleration");
    99     if ((SET_VIDEO_ACCEL == eWhich) || (USAGE_ALL == eWhich))
     105    if (SET_VIDEO_ACCEL == eWhich || eWhich == USAGE_ALL)
    100106        doUsage("<on|off>", g_pszProgName, "setvideoacceleration");
    101     if ((LIST_CUST_MODES == eWhich) || (USAGE_ALL == eWhich))
     107    if (LIST_CUST_MODES == eWhich || eWhich == USAGE_ALL)
    102108        doUsage("", g_pszProgName, "listcustommodes");
    103     if ((ADD_CUST_MODE == eWhich) || (USAGE_ALL == eWhich))
     109    if (ADD_CUST_MODE == eWhich || eWhich == USAGE_ALL)
    104110        doUsage("<width> <height> <bpp>", g_pszProgName, "addcustommode");
    105     if ((REMOVE_CUST_MODE == eWhich) || (USAGE_ALL == eWhich))
     111    if (REMOVE_CUST_MODE == eWhich || eWhich == USAGE_ALL)
    106112        doUsage("<width> <height> <bpp>", g_pszProgName, "removecustommode");
    107     if ((SET_VIDEO_MODE == eWhich) || (USAGE_ALL == eWhich))
     113    if (SET_VIDEO_MODE == eWhich || eWhich == USAGE_ALL)
    108114        doUsage("<width> <height> <bpp> <screen>", g_pszProgName, "setvideomode");
    109115#endif
    110116#ifdef VBOX_WITH_GUEST_PROPS
    111     if ((GUEST_PROP == eWhich) || (USAGE_ALL == eWhich))
     117    if (GUEST_PROP == eWhich || eWhich == USAGE_ALL)
    112118    {
    113119        doUsage("get <property> [-verbose]", g_pszProgName, "guestproperty");
     
    120126#endif
    121127#ifdef VBOX_WITH_SHARED_FOLDERS
    122     if ((GUEST_SHAREDFOLDERS == eWhich) || (USAGE_ALL == eWhich))
     128    if (GUEST_SHAREDFOLDERS == eWhich || eWhich == USAGE_ALL)
    123129    {
    124130        doUsage("list [-automount]", g_pszProgName, "sharedfolder");
    125131    }
    126132#endif
    127 }
     133
     134    if (eWhich == TAKE_SNAPSHOT || eWhich == USAGE_ALL)
     135        doUsage("", g_pszProgName, "takesnapshot");
     136    if (eWhich == SAVE_STATE || eWhich == USAGE_ALL)
     137        doUsage("", g_pszProgName, "savestate");
     138    if (eWhich == SUSPEND   || eWhich == USAGE_ALL)
     139        doUsage("", g_pszProgName, "suspend");
     140    if (eWhich == POWER_OFF  || eWhich == USAGE_ALL)
     141        doUsage("", g_pszProgName, "poweroff");
     142    if (eWhich == HELP      || eWhich == USAGE_ALL)
     143        doUsage("[command]", g_pszProgName, "help");
     144    if (eWhich == VERSION   || eWhich == USAGE_ALL)
     145        doUsage("", g_pszProgName, "version");
     146}
     147
    128148/** @} */
    129149
     
    13831403#endif
    13841404
     1405/**
     1406 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: takesnapshot}
     1407 */
     1408static RTEXITCODE handleTakeSnapshot(int argc, char *argv[])
     1409{
     1410    return VBoxControlError("not implemented");
     1411}
     1412
     1413/**
     1414 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: savestate}
     1415 */
     1416static RTEXITCODE handleSaveState(int argc, char *argv[])
     1417{
     1418    return VBoxControlError("not implemented");
     1419}
     1420
     1421/**
     1422 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: suspend|pause}
     1423 */
     1424static RTEXITCODE handleSuspend(int argc, char *argv[])
     1425{
     1426    return VBoxControlError("not implemented");
     1427}
     1428
     1429/**
     1430 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: poweroff|powerdown}
     1431 */
     1432static RTEXITCODE handlePowerOff(int argc, char *argv[])
     1433{
     1434    return VBoxControlError("not implemented");
     1435}
     1436
     1437/**
     1438 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: version}
     1439 */
    13851440static RTEXITCODE handleVersion(int argc, char *argv[])
    13861441{
     
    13911446}
    13921447
     1448/**
     1449 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: help}
     1450 */
    13931451static RTEXITCODE handleHelp(int argc, char *argv[])
    13941452{
     
    13991457
    14001458/** command handler type */
    1401 typedef DECLCALLBACK(RTEXITCODE) FNHANDLER(int argc, char *argv[]);
    1402 typedef FNHANDLER *PFNHANDLER;
     1459typedef DECLCALLBACK(RTEXITCODE) FNVBOXCTRLCMDHANDLER(int argc, char *argv[]);
     1460typedef FNVBOXCTRLCMDHANDLER *PFNVBOXCTRLCMDHANDLER;
    14031461
    14041462/** The table of all registered command handlers. */
     
    14061464{
    14071465    const char *pszCommand;
    1408     PFNHANDLER pfnHandler;
     1466    PFNVBOXCTRLCMDHANDLER pfnHandler;
    14091467} g_aCommandHandlers[] =
    14101468{
     
    14231481    { "sharedfolder",           handleSharedFolder },
    14241482#endif
     1483    { "takesnapshot",           handleTakeSnapshot },
     1484    { "savestate",              handleSaveState },
     1485    { "suspend",                handleSuspend },
     1486    { "pause",                  handleSuspend },
     1487    { "poweroff",               handlePowerOff },
     1488    { "powerdown",              handlePowerOff },
    14251489    { "getversion",             handleVersion },
    14261490    { "version",                handleVersion },
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