Changeset 15401 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- Dec 12, 2008 10:05:34 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40850
- Location:
- trunk/src/VBox/Main/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/HostHardwareLinux.h
r14991 r15401 7 7 8 8 /* 9 * Copyright (C) 200 6-2007Sun Microsystems, Inc.9 * Copyright (C) 2008 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 * additional information or have any questions. 22 22 */ 23 24 #ifndef ____H_HOSTHARDWARELINUX 25 # define ____H_HOSTHARDWARELINUX 23 26 24 27 #include <iprt/err.h> … … 111 114 typedef VBoxMainDriveInfo::DriveInfo DriveInfo; 112 115 116 /** 117 * Class for probing and returning information about host USB devices 118 */ 119 class VBoxMainUSBDeviceInfo 120 { 121 public: 122 /** Structure describing a host USB device */ 123 struct USBDeviceInfo 124 { 125 /** The device node of the device. */ 126 std::string mDevice; 127 /** The sysfs path of the device. */ 128 std::string mSysfsPath; 129 /** Type for the list of interfaces. */ 130 typedef std::vector <std::string> InterfaceList; 131 /** The sysfs paths of the device's interfaces. */ 132 InterfaceList mInterfaces; 133 134 /** Constructors */ 135 USBDeviceInfo (std::string aDevice, std::string aSysfsPath) 136 : mDevice (aDevice), mSysfsPath (aSysfsPath) {} 137 USBDeviceInfo () {} 138 }; 139 140 /** List (resp vector) holding drive information */ 141 typedef std::vector <USBDeviceInfo> DeviceInfoList; 142 143 /** 144 * Search for host USB devices and rebuild the list, which remains empty 145 * until the first time it is called. 146 * @returns iprt status code 147 */ 148 int UpdateDevices (); 149 150 /** Get the first element in the list of USB devices. */ 151 DeviceInfoList::const_iterator DevicesBegin() 152 { 153 return mDeviceList.begin(); 154 } 155 156 /** Get the last element in the list of USB devices. */ 157 DeviceInfoList::const_iterator DevicesEnd() 158 { 159 return mDeviceList.end(); 160 } 161 162 private: 163 /** The list of currently available USB devices */ 164 DeviceInfoList mDeviceList; 165 }; 166 167 typedef VBoxMainUSBDeviceInfo::DeviceInfoList USBDeviceInfoList; 168 typedef VBoxMainUSBDeviceInfo::USBDeviceInfo USBDeviceInfo; 169 typedef VBoxMainUSBDeviceInfo::USBDeviceInfo::InterfaceList USBInterfaceList; 170 171 class VBoxMainHotplugWaiter 172 { 173 /** Opaque context struct. */ 174 struct Context; 175 176 /** Opaque waiter context. */ 177 Context *mContext; 178 public: 179 /** Constructor */ 180 VBoxMainHotplugWaiter (void); 181 /** Destructor. */ 182 ~VBoxMainHotplugWaiter (void); 183 /** 184 * Wait for a hotplug event. 185 * 186 * @returns VINF_SUCCESS if an event occurred or if Interrupt() was called. 187 * @returns VERR_TRY_AGAIN if the wait failed but this might (!) be a 188 * temporary failure. 189 * @returns VERR_NOT_SUPPORTED if the wait failed and will definitely not 190 * succeed if retried. 191 * @returns Possibly other iprt status codes otherwise. 192 */ 193 int Wait (void); 194 /** Interrupts an active wait. */ 195 void Interrupt (void); 196 }; 197 198 #endif /* ____H_HOSTHARDWARELINUX */ 199 -
trunk/src/VBox/Main/include/vbox-dbus.h
r15058 r15401 29 29 #define LIB_DBUS_1_3 "libdbus-1.so.3" 30 30 31 /** Types from the dbus header files which we need. These are taken more or less32 31 /** Types and defines from the dbus header files which we need. These are 32 * taken more or less verbatim from the DBus public interface header files. */ 33 33 struct DBusError 34 34 { … … 68 68 typedef struct DBusMessageIter DBusMessageIter; 69 69 70 /** Defines from the dbus header files which we need. These are taken more or less71 verbatim from the DBus public interface header files. */72 70 #define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory" 73 71 #define DBUS_TYPE_STRING ((int) 's') 74 72 #define DBUS_TYPE_ARRAY ((int) 'a') 75 73 #define DBUS_TYPE_DICT_ENTRY ((int) 'e') 74 75 typedef enum 76 { 77 DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need 78 to run more handlers. */ 79 DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see 80 if other handlers want it. */ 81 DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return 82 #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try 83 again later with more memory. */ 84 } DBusHandlerResult; 85 86 typedef DBusHandlerResult (*DBusHandleMessageFunction) (DBusConnection *, 87 DBusMessage *, void *); 88 typedef void (*DBusFreeFunction) (void *); 76 89 77 90 /** The following are the symbols which we need from libdbus-1. */ … … 100 113 extern void (*dbus_message_iter_get_basic) (DBusMessageIter *, void *); 101 114 extern dbus_bool_t (*dbus_message_iter_next) (DBusMessageIter *); 115 extern dbus_bool_t (*dbus_connection_add_filter) (DBusConnection *, DBusHandleMessageFunction, 116 void *, DBusFreeFunction); 117 extern void (*dbus_connection_remove_filter) (DBusConnection *, DBusHandleMessageFunction, 118 void *); 119 extern dbus_bool_t (*dbus_connection_read_write_dispatch) (DBusConnection *, int); 120 extern dbus_bool_t (*dbus_message_is_signal) (DBusMessage *, const char *, const char *); 102 121 103 122 extern bool VBoxDBusCheckPresence(void);
Note:
See TracChangeset
for help on using the changeset viewer.