Changeset 32207 in vbox for trunk/src/VBox
- Timestamp:
- Sep 2, 2010 2:22:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
r32205 r32207 82 82 GUEST_SHAREDFOLDERS, 83 83 #endif 84 TAKE_SNAPSHOT, 85 SAVE_STATE, 86 SUSPEND, 87 POWER_OFF, 88 VERSION, 89 HELP, 84 90 USAGE_ALL = UINT32_MAX 85 91 }; … … 95 101 * them can fix this. */ 96 102 #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) 98 104 doUsage("", g_pszProgName, "getvideoacceleration"); 99 if ( (SET_VIDEO_ACCEL == eWhich) || (USAGE_ALL == eWhich))105 if (SET_VIDEO_ACCEL == eWhich || eWhich == USAGE_ALL) 100 106 doUsage("<on|off>", g_pszProgName, "setvideoacceleration"); 101 if ( (LIST_CUST_MODES == eWhich) || (USAGE_ALL == eWhich))107 if (LIST_CUST_MODES == eWhich || eWhich == USAGE_ALL) 102 108 doUsage("", g_pszProgName, "listcustommodes"); 103 if ( (ADD_CUST_MODE == eWhich) || (USAGE_ALL == eWhich))109 if (ADD_CUST_MODE == eWhich || eWhich == USAGE_ALL) 104 110 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) 106 112 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) 108 114 doUsage("<width> <height> <bpp> <screen>", g_pszProgName, "setvideomode"); 109 115 #endif 110 116 #ifdef VBOX_WITH_GUEST_PROPS 111 if ( (GUEST_PROP == eWhich) || (USAGE_ALL == eWhich))117 if (GUEST_PROP == eWhich || eWhich == USAGE_ALL) 112 118 { 113 119 doUsage("get <property> [-verbose]", g_pszProgName, "guestproperty"); … … 120 126 #endif 121 127 #ifdef VBOX_WITH_SHARED_FOLDERS 122 if ( (GUEST_SHAREDFOLDERS == eWhich) || (USAGE_ALL == eWhich))128 if (GUEST_SHAREDFOLDERS == eWhich || eWhich == USAGE_ALL) 123 129 { 124 130 doUsage("list [-automount]", g_pszProgName, "sharedfolder"); 125 131 } 126 132 #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 128 148 /** @} */ 129 149 … … 1383 1403 #endif 1384 1404 1405 /** 1406 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: takesnapshot} 1407 */ 1408 static RTEXITCODE handleTakeSnapshot(int argc, char *argv[]) 1409 { 1410 return VBoxControlError("not implemented"); 1411 } 1412 1413 /** 1414 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: savestate} 1415 */ 1416 static RTEXITCODE handleSaveState(int argc, char *argv[]) 1417 { 1418 return VBoxControlError("not implemented"); 1419 } 1420 1421 /** 1422 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: suspend|pause} 1423 */ 1424 static RTEXITCODE handleSuspend(int argc, char *argv[]) 1425 { 1426 return VBoxControlError("not implemented"); 1427 } 1428 1429 /** 1430 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: poweroff|powerdown} 1431 */ 1432 static RTEXITCODE handlePowerOff(int argc, char *argv[]) 1433 { 1434 return VBoxControlError("not implemented"); 1435 } 1436 1437 /** 1438 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: version} 1439 */ 1385 1440 static RTEXITCODE handleVersion(int argc, char *argv[]) 1386 1441 { … … 1391 1446 } 1392 1447 1448 /** 1449 * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: help} 1450 */ 1393 1451 static RTEXITCODE handleHelp(int argc, char *argv[]) 1394 1452 { … … 1399 1457 1400 1458 /** command handler type */ 1401 typedef DECLCALLBACK(RTEXITCODE) FN HANDLER(int argc, char *argv[]);1402 typedef FN HANDLER *PFNHANDLER;1459 typedef DECLCALLBACK(RTEXITCODE) FNVBOXCTRLCMDHANDLER(int argc, char *argv[]); 1460 typedef FNVBOXCTRLCMDHANDLER *PFNVBOXCTRLCMDHANDLER; 1403 1461 1404 1462 /** The table of all registered command handlers. */ … … 1406 1464 { 1407 1465 const char *pszCommand; 1408 PFN HANDLER pfnHandler;1466 PFNVBOXCTRLCMDHANDLER pfnHandler; 1409 1467 } g_aCommandHandlers[] = 1410 1468 { … … 1423 1481 { "sharedfolder", handleSharedFolder }, 1424 1482 #endif 1483 { "takesnapshot", handleTakeSnapshot }, 1484 { "savestate", handleSaveState }, 1485 { "suspend", handleSuspend }, 1486 { "pause", handleSuspend }, 1487 { "poweroff", handlePowerOff }, 1488 { "powerdown", handlePowerOff }, 1425 1489 { "getversion", handleVersion }, 1426 1490 { "version", handleVersion },
Note:
See TracChangeset
for help on using the changeset viewer.