1fc982701SJohn Scipione/* 2b885e90eSJohn Scipione * Copyright 2003-2014 Haiku, Inc. All rights reserved. 3fc982701SJohn Scipione * Distributed under the terms of the MIT License. 4fc982701SJohn Scipione * 5fc982701SJohn Scipione * Authors: 6fc982701SJohn Scipione * Axel Dörfler, axeld@pinc-software.de 7fc982701SJohn Scipione * John Scipione, jscipione@gmail.com 8fc982701SJohn Scipione * Ingo Weinhold, bonefish@users.sf.net 9fc982701SJohn Scipione * Clemens Zeidler, haiku@clemens-zeidler.de 10fc982701SJohn Scipione * 11fc982701SJohn Scipione * Corresponds to: 12*5efee6dfSJohn Scipione * headers/os/storage/NodeMonitor.h hrev47403 13*5efee6dfSJohn Scipione * src/kits/storage/NodeMonitor.cpp hrev47403 14fc982701SJohn Scipione */ 15fc982701SJohn Scipione 16fc982701SJohn Scipione 17fc982701SJohn Scipione/*! 18fc982701SJohn Scipione \file NodeMonitor.h 19fc982701SJohn Scipione \ingroup storage 20fc982701SJohn Scipione \ingroup libbe 21fc982701SJohn Scipione \brief Provides functions and constants for monitoring changes to a node. 22fc982701SJohn Scipione 23fc982701SJohn Scipione The are three main node monitoring functions are watch_volume(), 24b885e90eSJohn Scipione watch_node(), and stop_watching(). 25fc982701SJohn Scipione - watch_volume() starts watching a volume and sends a message 26fc982701SJohn Scipione when a requested event occurs. 27fc982701SJohn Scipione - watch_node() starts or stops watching a node, or watches for volumes 28fc982701SJohn Scipione to be mounted and unmounted, and sends a message when an event occurs. 29fc982701SJohn Scipione - stop_watching() stops monitoring a node or volume and no longer sends 30fc982701SJohn Scipione messages. 31fc982701SJohn Scipione*/ 32fc982701SJohn Scipione 33fc982701SJohn Scipione 34b885e90eSJohn Scipione//// Flags for the watch_node() call. 35b885e90eSJohn Scipione 36b885e90eSJohn Scipione 37fc982701SJohn Scipione/*! 38fc982701SJohn Scipione \var B_STOP_WATCHING 39b885e90eSJohn Scipione \brief Unsubscribe from watching a node. 40fc982701SJohn Scipione 41b885e90eSJohn Scipione Flag for watch_node(). 42880e147bSJohn Scipione 43880e147bSJohn Scipione \attention \c B_STOP_WATCHING does not apply to volume watching, you must 44880e147bSJohn Scipione call stop_watching() instead. 45b885e90eSJohn Scipione 46b885e90eSJohn Scipione \since BeOS R3 47fc982701SJohn Scipione*/ 48fc982701SJohn Scipione 49fc982701SJohn Scipione 50fc982701SJohn Scipione/*! 51fc982701SJohn Scipione \var B_WATCH_NAME 52b885e90eSJohn Scipione \brief Subscribe to watching for change to the name of a node. 53fc982701SJohn Scipione 54b885e90eSJohn Scipione Flag for watch_volume() and watch_node(). 55b885e90eSJohn Scipione 56b885e90eSJohn Scipione \since BeOS R3 57fc982701SJohn Scipione*/ 58fc982701SJohn Scipione 59fc982701SJohn Scipione 60fc982701SJohn Scipione/*! 61fc982701SJohn Scipione \var B_WATCH_STAT 62b885e90eSJohn Scipione \brief Subscribe to watching for changes to the stat information of a node. 63fc982701SJohn Scipione 64b885e90eSJohn Scipione Flag for watch_volume() and watch_node(). 65b885e90eSJohn Scipione 66b885e90eSJohn Scipione \since BeOS R3 67fc982701SJohn Scipione*/ 68fc982701SJohn Scipione 69fc982701SJohn Scipione 70fc982701SJohn Scipione/*! 71fc982701SJohn Scipione \var B_WATCH_ATTR 72b885e90eSJohn Scipione \brief Subscribe to watching for changes to the attributes of a node. 73fc982701SJohn Scipione 74b885e90eSJohn Scipione Flag for watch_volume() and watch_node(). 75b885e90eSJohn Scipione 76b885e90eSJohn Scipione \since BeOS R3 77fc982701SJohn Scipione*/ 78fc982701SJohn Scipione 79fc982701SJohn Scipione 80fc982701SJohn Scipione/*! 81fc982701SJohn Scipione \var B_WATCH_DIRECTORY 82b885e90eSJohn Scipione \brief Subscribe to watching for changes to the contents of a directory. 83fc982701SJohn Scipione 84b885e90eSJohn Scipione Flag for watch_node(). 85b885e90eSJohn Scipione 86b885e90eSJohn Scipione \since BeOS R3 87fc982701SJohn Scipione*/ 88fc982701SJohn Scipione 89fc982701SJohn Scipione 90fc982701SJohn Scipione/*! 91fc982701SJohn Scipione \var B_WATCH_ALL 92b885e90eSJohn Scipione \brief Flag for watch_node(). 93fc982701SJohn Scipione 94b885e90eSJohn Scipione Subscribe to watching for changes to all information of a node except 95b885e90eSJohn Scipione \c B_WATCH_MOUNT. 96b885e90eSJohn Scipione 97b885e90eSJohn Scipione \since BeOS R3 98fc982701SJohn Scipione*/ 99fc982701SJohn Scipione 100fc982701SJohn Scipione 101fc982701SJohn Scipione/*! 102fc982701SJohn Scipione \var B_WATCH_MOUNT 103b885e90eSJohn Scipione \brief Subscribe to watching for when a volume is mounted or unmounted. 104fc982701SJohn Scipione 105b885e90eSJohn Scipione You may prefer to use BVolumeRoster for volume watching instead. 106b885e90eSJohn Scipione 107b885e90eSJohn Scipione Flag for watch_node(). 108b885e90eSJohn Scipione 109b885e90eSJohn Scipione \since BeOS R3 110fc982701SJohn Scipione*/ 111fc982701SJohn Scipione 112fc982701SJohn Scipione 113fc982701SJohn Scipione/*! 114fc982701SJohn Scipione \var B_WATCH_INTERIM_STAT 115b885e90eSJohn Scipione \brief To avoid a flood of messages for small and frequent write operations 116b885e90eSJohn Scipione on an open file the file system can limit the number of 117b885e90eSJohn Scipione notifications and mark them with the \c B_WATCH_INTERIM_STAT flag. 118fc982701SJohn Scipione 119b885e90eSJohn Scipione \internal Implementation detail, not in Be Book. 120fc982701SJohn Scipione 121b885e90eSJohn Scipione \since Haiku R1 122fc982701SJohn Scipione*/ 123fc982701SJohn Scipione 124fc982701SJohn Scipione 125*5efee6dfSJohn Scipione// The "opcode" field of the B_NODE_MONITOR notification message you get. 126b885e90eSJohn Scipione 127b885e90eSJohn Scipione 128fc982701SJohn Scipione/*! 129*5efee6dfSJohn Scipione \def B_ENTRY_CREATED 130*5efee6dfSJohn Scipione \brief \c B_NODE_MONITOR notification message "opcode" is set when entry is 131b3252dc1SJohn Scipione created. 132b885e90eSJohn Scipione 133b885e90eSJohn Scipione \since BeOS R3 134fc982701SJohn Scipione*/ 135fc982701SJohn Scipione 136fc982701SJohn Scipione 137fc982701SJohn Scipione/*! 138*5efee6dfSJohn Scipione \def B_ENTRY_REMOVED 139*5efee6dfSJohn Scipione \brief \c B_NODE_MONITOR notification message "opcode" is set when entry is 140b3252dc1SJohn Scipione removed. 141b885e90eSJohn Scipione 142b885e90eSJohn Scipione \since BeOS R3 143fc982701SJohn Scipione*/ 144fc982701SJohn Scipione 145fc982701SJohn Scipione 146fc982701SJohn Scipione/*! 147*5efee6dfSJohn Scipione \def B_ENTRY_MOVED 148*5efee6dfSJohn Scipione \brief \c B_NODE_MONITOR notification message "opcode" is set when entry is 149b3252dc1SJohn Scipione moved. 150b885e90eSJohn Scipione 151b885e90eSJohn Scipione \since BeOS R3 152fc982701SJohn Scipione*/ 153fc982701SJohn Scipione 154fc982701SJohn Scipione 155fc982701SJohn Scipione/*! 156*5efee6dfSJohn Scipione \def B_STAT_CHANGED 157*5efee6dfSJohn Scipione \brief \c B_NODE_MONITOR notification message "opcode" set when stat info 158*5efee6dfSJohn Scipione changes. 159fc982701SJohn Scipione 160*5efee6dfSJohn Scipione More information can be found in the "fields" field. 161b885e90eSJohn Scipione 162b885e90eSJohn Scipione \since BeOS R3 163fc982701SJohn Scipione*/ 164fc982701SJohn Scipione 165fc982701SJohn Scipione 166fc982701SJohn Scipione/*! 167*5efee6dfSJohn Scipione \def B_ATTR_CHANGED 168*5efee6dfSJohn Scipione \brief \c B_NODE_MONITOR notification message "opcode" set when attribute 169*5efee6dfSJohn Scipione changes. 170fc982701SJohn Scipione 171*5efee6dfSJohn Scipione More information can be found in the "cause" field. 172b885e90eSJohn Scipione 173b885e90eSJohn Scipione \since BeOS R3 174fc982701SJohn Scipione*/ 175fc982701SJohn Scipione 176fc982701SJohn Scipione 177fc982701SJohn Scipione/*! 178*5efee6dfSJohn Scipione \def B_DEVICE_MOUNTED 179*5efee6dfSJohn Scipione \brief \c B_NODE_MONITOR notification message "opcode" set when device is 180b3252dc1SJohn Scipione mounted. 181b885e90eSJohn Scipione 182b885e90eSJohn Scipione \since BeOS R3 183fc982701SJohn Scipione*/ 184fc982701SJohn Scipione 185fc982701SJohn Scipione 186fc982701SJohn Scipione/*! 187*5efee6dfSJohn Scipione \def B_DEVICE_UNMOUNTED 188*5efee6dfSJohn Scipione \brief \c B_NODE_MONITOR notification message "opcode" set when device is 189b3252dc1SJohn Scipione unmounted. 190b885e90eSJohn Scipione 191b885e90eSJohn Scipione \since BeOS R3 192fc982701SJohn Scipione*/ 193fc982701SJohn Scipione 194fc982701SJohn Scipione 195*5efee6dfSJohn Scipione// More specific info in the "cause" field of B_ATTR_CHANGED notification 196*5efee6dfSJohn Scipione// messages. 197fc982701SJohn Scipione 198*5efee6dfSJohn Scipione 199*5efee6dfSJohn Scipione/*! 200*5efee6dfSJohn Scipione \def B_ATTR_CREATED 201*5efee6dfSJohn Scipione \brief \c B_ATTR_CHANGED notification message "cause" set when attribute is 202b885e90eSJohn Scipione created. 203b885e90eSJohn Scipione 204b885e90eSJohn Scipione \since Haiku R1 205fc982701SJohn Scipione*/ 206fc982701SJohn Scipione 207fc982701SJohn Scipione 208fc982701SJohn Scipione/*! 209*5efee6dfSJohn Scipione \def B_ATTR_REMOVED 210*5efee6dfSJohn Scipione \brief \c B_ATTR_CHANGED notification message "cause" set when attribute is 211b885e90eSJohn Scipione removed. 212b885e90eSJohn Scipione 213b885e90eSJohn Scipione \since Haiku R1 214fc982701SJohn Scipione*/ 215fc982701SJohn Scipione 216fc982701SJohn Scipione 217*5efee6dfSJohn Scipione// More specific info in the "fields" field of B_STAT_CHANGED notification 218*5efee6dfSJohn Scipione// messages, specifying what parts of the stat data have actually been 219*5efee6dfSJohn Scipione// changed. 220*5efee6dfSJohn Scipione 221*5efee6dfSJohn Scipione 222fc982701SJohn Scipione/*! 223fc982701SJohn Scipione \var B_STAT_MODE 224b885e90eSJohn Scipione \brief Set when stat mode changes. 225fc982701SJohn Scipione 226b885e90eSJohn Scipione \c B_STAT_CHANGED notification messages "fields" flag. 227b885e90eSJohn Scipione 228b885e90eSJohn Scipione \since Haiku R1 229fc982701SJohn Scipione*/ 230fc982701SJohn Scipione 231fc982701SJohn Scipione 232fc982701SJohn Scipione/*! 233fc982701SJohn Scipione \var B_STAT_UID 234b885e90eSJohn Scipione \brief Set when UID changes. 235fc982701SJohn Scipione 236b885e90eSJohn Scipione \c B_STAT_CHANGED notification messages "fields" flag. 237b885e90eSJohn Scipione 238b885e90eSJohn Scipione \since Haiku R1 239fc982701SJohn Scipione*/ 240fc982701SJohn Scipione 241fc982701SJohn Scipione 242fc982701SJohn Scipione/*! 243fc982701SJohn Scipione \var B_STAT_GID 244b885e90eSJohn Scipione \brief Set when GID changes. 245fc982701SJohn Scipione 246b885e90eSJohn Scipione \c B_STAT_CHANGED notification messages "fields" flag. 247b885e90eSJohn Scipione 248b885e90eSJohn Scipione \since Haiku R1 249fc982701SJohn Scipione*/ 250fc982701SJohn Scipione 251fc982701SJohn Scipione 252fc982701SJohn Scipione/*! 253fc982701SJohn Scipione \var B_STAT_SIZE 254b885e90eSJohn Scipione \brief Set when stat size changes. 255fc982701SJohn Scipione 256b885e90eSJohn Scipione \c B_STAT_CHANGED notification messages "fields" flag. 257b885e90eSJohn Scipione 258b885e90eSJohn Scipione \since Haiku R1 259fc982701SJohn Scipione*/ 260fc982701SJohn Scipione 261fc982701SJohn Scipione 262fc982701SJohn Scipione/*! 263fc982701SJohn Scipione \var B_STAT_ACCESS_TIME 264b885e90eSJohn Scipione \brief Set when access time changes. 265fc982701SJohn Scipione 266b885e90eSJohn Scipione \c B_STAT_CHANGED notification messages "fields" flag. 267b885e90eSJohn Scipione 268b885e90eSJohn Scipione \since Haiku R1 269fc982701SJohn Scipione*/ 270fc982701SJohn Scipione 271fc982701SJohn Scipione 272fc982701SJohn Scipione/*! 273fc982701SJohn Scipione \var B_STAT_MODIFICATION_TIME 274b885e90eSJohn Scipione \brief Set when modification time changes. 275fc982701SJohn Scipione 276b885e90eSJohn Scipione \c B_STAT_CHANGED notification messages "fields" flag. 277b885e90eSJohn Scipione 278b885e90eSJohn Scipione \since Haiku R1 279fc982701SJohn Scipione*/ 280fc982701SJohn Scipione 281fc982701SJohn Scipione 282fc982701SJohn Scipione/*! 283fc982701SJohn Scipione \var B_STAT_CREATION_TIME 284b885e90eSJohn Scipione \brief Set when creation time changes. 285fc982701SJohn Scipione 286b885e90eSJohn Scipione \c B_STAT_CHANGED notification messages "fields" flag. 287b885e90eSJohn Scipione 288b885e90eSJohn Scipione \since Haiku R1 289fc982701SJohn Scipione*/ 290fc982701SJohn Scipione 291fc982701SJohn Scipione 292fc982701SJohn Scipione/*! 293fc982701SJohn Scipione \var B_STAT_CHANGE_TIME 294b885e90eSJohn Scipione \brief Set when access, modification or creation time changes. 295fc982701SJohn Scipione 296b885e90eSJohn Scipione \c B_STAT_CHANGED notification messages "fields" flag. 297b885e90eSJohn Scipione 298b885e90eSJohn Scipione \since Haiku R1 299fc982701SJohn Scipione*/ 300fc982701SJohn Scipione 301fc982701SJohn Scipione 302fc982701SJohn Scipione/*! 303fc982701SJohn Scipione \var B_STAT_INTERIM_UPDATE 304b885e90eSJohn Scipione \brief Set when file is written to. 305fc982701SJohn Scipione 306b885e90eSJohn Scipione \internal Implementation detail, not in Be Book. 307fc982701SJohn Scipione 308b885e90eSJohn Scipione \c B_STAT_CHANGED notification messages "fields" flag. 309b885e90eSJohn Scipione 310b885e90eSJohn Scipione \since Haiku R1 311fc982701SJohn Scipione*/ 312fc982701SJohn Scipione 313fc982701SJohn Scipione 314fc982701SJohn Scipione/*! 315fc982701SJohn Scipione \fn status_t watch_volume(dev_t volume, uint32 flags, BMessenger target) 316fc982701SJohn Scipione \brief Subscribes \a target to watch node changes on \a volume. 317fc982701SJohn Scipione 318fc982701SJohn Scipione Depending of \a flags the action performed by this function varies: 319fc982701SJohn Scipione - \a flags contains at least one of \c B_WATCH_NAME, \c B_WATCH_STAT, 320fc982701SJohn Scipione or <tt>B_WATCH_ATTR</tt>: The target is subscribed to watching the specified 321fc982701SJohn Scipione aspects of any node on the volume. 322fc982701SJohn Scipione 323fc982701SJohn Scipione \a flags may include: 324fc982701SJohn Scipione - \c B_WATCH_NAME 325fc982701SJohn Scipione - \c B_WATCH_STAT 326fc982701SJohn Scipione - \c B_WATCH_ATTR 327fc982701SJohn Scipione 328fc982701SJohn Scipione \c B_WATCH_VOLUME flag is assumed. 329fc982701SJohn Scipione 330fc982701SJohn Scipione \param volume dev_t referring to the volume to be watched. 331fc982701SJohn Scipione \param flags Flags indicating the actions to be performed. 332fc982701SJohn Scipione \param target Messenger referring to the target. Must be valid. 333fc982701SJohn Scipione 334fc982701SJohn Scipione \return A status code. 335fc982701SJohn Scipione \retval B_OK Everything went fine. 336fc982701SJohn Scipione \retval B_BAD_VALUE \a flags did not include one of \c B_WATCH_NAME, 337fc982701SJohn Scipione \c B_WATCH_STAT, or \c B_WATCH_ATTR. 338b885e90eSJohn Scipione 339b885e90eSJohn Scipione \since Haiku R1 340fc982701SJohn Scipione*/ 341fc982701SJohn Scipione 342fc982701SJohn Scipione 343fc982701SJohn Scipione/*! 344fc982701SJohn Scipione \fn status_t watch_volume(dev_t volume, uint32 flags, 345fc982701SJohn Scipione const BHandler* handler, const BLooper* looper) 346fc982701SJohn Scipione \brief Subscribes \a handler or \a looper to watch node changes on 347fc982701SJohn Scipione \a volume. 348fc982701SJohn Scipione 349fc982701SJohn Scipione Depending of \a flags the action performed by this function varies: 350fc982701SJohn Scipione - \a flags contains at least one of \c B_WATCH_NAME, \c B_WATCH_STAT, 351fc982701SJohn Scipione or <tt>B_WATCH_ATTR</tt>: The target is subscribed to watching the specified 352fc982701SJohn Scipione aspects of any node on the volume. 353fc982701SJohn Scipione 354fc982701SJohn Scipione \a flags may include: 355fc982701SJohn Scipione - \c B_WATCH_NAME 356fc982701SJohn Scipione - \c B_WATCH_STAT 357fc982701SJohn Scipione - \c B_WATCH_ATTR 358fc982701SJohn Scipione 359fc982701SJohn Scipione \c B_WATCH_VOLUME flag is assumed. 360fc982701SJohn Scipione 361fc982701SJohn Scipione \param volume dev_t referring to the volume to be watched. 362fc982701SJohn Scipione \param flags Flags indicating the actions to be performed. 363fc982701SJohn Scipione \param handler The target \a handler. May be \c NULL, if \a looper is not 364fc982701SJohn Scipione \c NULL. Then the preferred handler of the looper is targeted. 365fc982701SJohn Scipione \param looper The target \a looper. May be \c NULL, if \a handler is not 366fc982701SJohn Scipione \c NULL. Then the handler's looper is the target looper. 367fc982701SJohn Scipione 368fc982701SJohn Scipione \return A status code. 369fc982701SJohn Scipione \retval B_OK Everything went fine. 370fc982701SJohn Scipione \retval B_BAD_VALUE \a flags did not include one of \c B_WATCH_NAME, 371fc982701SJohn Scipione \c B_WATCH_STAT, or \c B_WATCH_ATTR. 372b885e90eSJohn Scipione 373b885e90eSJohn Scipione \since Haiku R1 374fc982701SJohn Scipione*/ 375fc982701SJohn Scipione 376fc982701SJohn Scipione 377fc982701SJohn Scipione/*! 378fc982701SJohn Scipione \fn status_t watch_node(const node_ref* node, uint32 flags, 379fc982701SJohn Scipione BMessenger target) 380fc982701SJohn Scipione \brief Subscribes or unsubscribes \a target to node and/or mount watching. 381fc982701SJohn Scipione 382fc982701SJohn Scipione Depending of \a flags the action performed by this function varies: 383fc982701SJohn Scipione - \a flags is 0: The target is unsubscribed from watching the node. 384fc982701SJohn Scipione \a node must not be \c NULL in this case. 385fc982701SJohn Scipione - \a flags contains \c B_WATCH_MOUNT: The target is subscribed to mount 386fc982701SJohn Scipione watching. 387fc982701SJohn Scipione - \a flags contains at least one of \c B_WATCH_NAME, \c B_WATCH_STAT, 388fc982701SJohn Scipione \c B_WATCH_ATTR, or <tt>B_WATCH_DIRECTORY</tt>: The target is subscribed to 389fc982701SJohn Scipione watching the specified aspects of the node. \a node must not be \c NULL 390fc982701SJohn Scipione in this case. 391fc982701SJohn Scipione 392fc982701SJohn Scipione \a flags may include: 393fc982701SJohn Scipione - \c B_STOP_WATCHING 394fc982701SJohn Scipione 395fc982701SJohn Scipione or one or more of the following: 396fc982701SJohn Scipione - \c B_WATCH_NAME 397fc982701SJohn Scipione - \c B_WATCH_STAT 398fc982701SJohn Scipione - \c B_WATCH_ATTR 399fc982701SJohn Scipione - \c B_WATCH_DIRECTORY 400fc982701SJohn Scipione - \c B_WATCH_ALL 401fc982701SJohn Scipione - \c B_WATCH_MOUNT 402fc982701SJohn Scipione 403880e147bSJohn Scipione Note that the latter two cases are not mutual exclusive, i.e. mount and 404fc982701SJohn Scipione node watching can be requested with a single call. 405fc982701SJohn Scipione 406fc982701SJohn Scipione \param node node_ref referring to the node to be watched. May be \c NULL, 407fc982701SJohn Scipione if only mount watching is requested. 408fc982701SJohn Scipione \param flags Flags indicating the actions to be performed. 409880e147bSJohn Scipione \param target BMessenger object referring to the \a target. 410fc982701SJohn Scipione 411fc982701SJohn Scipione \return \c B_OK if everything went fine, an error code otherwise. 412b885e90eSJohn Scipione 413b885e90eSJohn Scipione \since BeOS R3 414fc982701SJohn Scipione*/ 415fc982701SJohn Scipione 416fc982701SJohn Scipione 417fc982701SJohn Scipione/*! 418fc982701SJohn Scipione \fn status_t watch_node(const node_ref* node, uint32 flags, 419fc982701SJohn Scipione const BHandler* handler, const BLooper* looper) 420fc982701SJohn Scipione \brief Subscribes or unsubscribes \a handler or \a looper to node and/or 421fc982701SJohn Scipione mount watching. 422fc982701SJohn Scipione 423fc982701SJohn Scipione Depending of \a flags the action performed by this function varies: 424fc982701SJohn Scipione - \a flags is 0: The target is unsubscribed from watching the node. 425fc982701SJohn Scipione \a node must not be \c NULL in this case. 426fc982701SJohn Scipione - \a flags contains \c B_WATCH_MOUNT: The target is subscribed to mount 427fc982701SJohn Scipione watching. 428fc982701SJohn Scipione - \a flags contains at least one of \c B_WATCH_NAME, \c B_WATCH_STAT, 429fc982701SJohn Scipione \c B_WATCH_ATTR, or <tt>B_WATCH_DIRECTORY</tt>: The target is subscribed to 430fc982701SJohn Scipione watching the specified aspects of the node. \a node must not be \c NULL 431fc982701SJohn Scipione in this case. 432fc982701SJohn Scipione 433fc982701SJohn Scipione \a flags may include: 434fc982701SJohn Scipione - \c B_STOP_WATCHING 435fc982701SJohn Scipione 436fc982701SJohn Scipione or one or more of the following: 437fc982701SJohn Scipione - \c B_WATCH_NAME 438fc982701SJohn Scipione - \c B_WATCH_STAT 439fc982701SJohn Scipione - \c B_WATCH_ATTR 440fc982701SJohn Scipione - \c B_WATCH_DIRECTORY 441fc982701SJohn Scipione - \c B_WATCH_ALL 442fc982701SJohn Scipione - \c B_WATCH_MOUNT 443fc982701SJohn Scipione 444880e147bSJohn Scipione Note that the latter two cases are not mutual exclusive, i.e. mount and 445fc982701SJohn Scipione node watching can be requested with a single call. 446fc982701SJohn Scipione 447fc982701SJohn Scipione \param node node_ref referring to the node to be watched. May be \c NULL, 448fc982701SJohn Scipione if only mount watching is requested. 449fc982701SJohn Scipione \param flags Flags indicating the actions to be performed. 450fc982701SJohn Scipione \param handler The target handler. May be \c NULL, if \a looper is not 451fc982701SJohn Scipione \c NULL. Then the preferred handler of the looper is targeted. 452fc982701SJohn Scipione \param looper The target looper. May be \c NULL, if \a handler is not 453fc982701SJohn Scipione \c NULL. Then the handler's looper is the target looper. 454fc982701SJohn Scipione 455fc982701SJohn Scipione \return \c B_OK if everything went fine, an error code otherwise. 456b885e90eSJohn Scipione 457b885e90eSJohn Scipione \since BeOS R3 458fc982701SJohn Scipione*/ 459fc982701SJohn Scipione 460fc982701SJohn Scipione 461fc982701SJohn Scipione/*! 462fc982701SJohn Scipione \fn status_t stop_watching(BMessenger target) 463fc982701SJohn Scipione \brief Unsubscribes \a target from node and mount monitoring. 464fc982701SJohn Scipione 465880e147bSJohn Scipione You may still receive notification messages after calling stop_watching() 466880e147bSJohn Scipione because while node monitoring is asynchronous and all changes are atomic, 467880e147bSJohn Scipione message sending is not atomic so there is a lag time from when you 468880e147bSJohn Scipione stop monitoring and when the message is received in your message receiving 469880e147bSJohn Scipione thread. You can check the timestamp of the message to determine if 470880e147bSJohn Scipione it was sent after stop_watching() was called. 471fc982701SJohn Scipione 472880e147bSJohn Scipione \param target BMessenger object referring to the \a target. 473880e147bSJohn Scipione 474880e147bSJohn Scipione \return A status code. 475880e147bSJohn Scipione \retval B_OK Stopped sending notification messages to the \a target. 476880e147bSJohn Scipione \retval B_BAD_VALUE \a target was invalid. 477880e147bSJohn Scipione \retval B_ENTRY_NOT_FOUND Node not found. 478b885e90eSJohn Scipione 479b885e90eSJohn Scipione \since BeOS R3 480fc982701SJohn Scipione*/ 481fc982701SJohn Scipione 482fc982701SJohn Scipione 483fc982701SJohn Scipione/*! 484fc982701SJohn Scipione \fn status_t stop_watching(const BHandler* handler, const BLooper* looper) 485880e147bSJohn Scipione \brief Unsubscribes \a handler or \a looper target from node and mount 486880e147bSJohn Scipione monitoring. 487fc982701SJohn Scipione 488880e147bSJohn Scipione You may still receive notification messages after calling stop_watching() 489880e147bSJohn Scipione because while node monitoring is asynchronous and all changes are atomic, 490880e147bSJohn Scipione message sending is not atomic so there is a lag time from when you 491880e147bSJohn Scipione stop monitoring and when the message is received in your message receiving 492880e147bSJohn Scipione thread. You can check the timestamp of the message to determine if 493880e147bSJohn Scipione it was sent after stop_watching() was called. 494fc982701SJohn Scipione 495880e147bSJohn Scipione \param handler The target handler, may be \c NULL. If \a looper is not 496880e147bSJohn Scipione \c NULL then the looper's preferred handler is targeted. 497880e147bSJohn Scipione \param looper The target looper, may be \c NULL. If \a handler is not 498880e147bSJohn Scipione \c NULL then the handler's looper is targeted. 499880e147bSJohn Scipione 500880e147bSJohn Scipione \return A status code. 501880e147bSJohn Scipione \retval B_OK Stopped sending notification messages to the target. 502880e147bSJohn Scipione \retval B_BAD_VALUE Target from \a handler or \a looper was invalid. 503880e147bSJohn Scipione \retval B_ENTRY_NOT_FOUND Node not found. 504b885e90eSJohn Scipione 505b885e90eSJohn Scipione \since BeOS R3 506fc982701SJohn Scipione*/ 507