Large documentation update:

- Add the beginnings of the documentation for the USB module
- Fix some mistakes here and there
- Almost finished the support kit. Tried to update everything to the standards

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20724 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Niels Sascha Reedijk
2007-04-16 09:28:29 +00:00
parent 3095921098
commit 81071f5e8a
21 changed files with 1687 additions and 554 deletions
+2
View File
@@ -465,6 +465,8 @@ INPUT = . \
midi2 \ midi2 \
support \ support \
../../headers/os/drivers/fs_interface.h \ ../../headers/os/drivers/fs_interface.h \
../../headers/os/drivers/USB3.h \
../../headers/os/drivers/USB_spec.h \
../../headers/os/midi2 \ ../../headers/os/midi2 \
../../headers/os/support \ ../../headers/os/support \
../../headers/posix/syslog.h ../../headers/posix/syslog.h
+18 -20
View File
@@ -79,35 +79,33 @@
against which the documentaton was written. against which the documentaton was written.
\verbatim \verbatim
// /*
// Copyright 2007, Haiku Inc. All Rights Reserved. * Copyright 2007, Haiku, Inc. All Rights Reserved.
// * Distributed under the terms of the MIT License.
// Distributed under the terms of the MIT License. *
// * Documentation by:
// * Niels Sascha Reedijk <[email protected]>
// Documentation by: * Corresponds to:
// Niels Sascha Reedijk <[email protected]> * /trunk/headers/os/support/String.h rev 19731
// Corresponds to: * /trunk/src/kits/support/String.cpp rev 19731
// /trunk/headers/os/support/String.h rev 19731 * /
// /trunk/src/kits/support/String.cpp rev 19731
//
\endverbatim \endverbatim
The example above has a few elements that you should take note of: The example above has a few elements that you should take note of:
-# First of all, every line starts with a C++ single line style comment. -# The header is put in a standard C comment, which are enclosed between
So it starts with two slashes: \c //. If there is text on a line, the \c /* and \c *\/.
tokens are followed by \e one space. If the text is part of a category, -# Every line starts with a whitespace and an asterix, followed by another
such as <tt>Documentation by</tt>, put two spaces after the delimeter. space. If the text is part of a category, such as <tt>Documentation
by</tt>, put three spaces after the delimeter.
-# We start with a copyright notice. The first line is empty, then the -# We start with a copyright notice. The first line is empty, then the
copyright notice, then another empty line, and then the line on \e MIT, copyright notice, then the line on \e MIT, followed by an empty line.
followed by two empty lines.
-# Then there is a label <tt>Documentation by:</tt>, which is followed by -# Then there is a label <tt>Documentation by:</tt>, which is followed by
lines with names and email addresses between brackets. lines with names and email addresses between brackets.
-# The final part is underneath the label <tt>Corresponds to:</tt>. -# The final part is underneath the label <tt>Corresponds to:</tt>.
Underneath there is a list of files and their svn revisions that the Underneath there is a list of files and their svn revisions that the
current documentation is known to correspond with. current documentation is known to correspond with.
-# The header block ends with an empty C++ comment, and the next block that -# The header block ends with the \c *\/, where the asterix is alligned with
follows underneath will start after an empty line. with the ones above it.
\subsection formalrequirements_blocks Blocks \subsection formalrequirements_blocks Blocks
+477
View File
@@ -0,0 +1,477 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/os/drivers/USB3.h rev 19915
*/
/*!
\file USB3.h
\ingroup drivers
\brief Interface for the USB module.
*/
/*!
\typedef struct usb_module_info usb_module_info
\brief The main interface object. See the usb_module_info documentation.
*/
/*!
\typedef uint32 usb_id
\brief Uniquely identify various USB objects that are used in the module.
*/
/*!
\typedef usb_id usb_device
\brief Uniquely identify USB devices.
*/
/*!
\typedef usb_id usb_interface
\brief Uniquely identify USB interfaces.
*/
/*!
\typedef usb_id usb_pipe
\brief Uniquely identify USB pipes.
*/
/*!
\typedef struct usb_endpoint_info usb_endpoint_info
\brief Container for USB endpoint descriptors.
\see Documentation for usb_endpoint_info.
*/
/*!
\typedef struct usb_interface_info usb_interface_info
\brief Container for USB interface descriptors.
\see Documentation for usb_interface_info.
*/
/*!
\typedef usb_interface_list usb_interface_list
\brief Container that holds a list of USB interface descriptors.
\see Documentation for usb_interface_list.
*/
/*!
\typedef struct usb_configuration_info usb_configuration_info
\brief Container for USB configuration descriptors.
\see Documentation for usb_configuration_info.
*/
///// usb_notify_hooks /////
/*!
\struct usb_notify_hooks
\brief Hooks that the USB stack can callback in case of events.
*/
/*!
\fn status_t (*usb_notify_hooks::device_added)(usb_device device, void **cookie)
\brief Called by the stack in case a device is added.
As soon as you have registered hooks using the
usb_module_info::install_notify() method, this hook will be called as soon as
a device is inserted that matches your provided usb_support_descriptor.
\param device A unique id that identifies this USB device.
\param[in] cookie You can store a pointer to an object in this variable.
When the device is removed, this cookie will be provided to you.
\return You should return \c B_OK in case of success. If you return an error
value, the \a device id will become invalid and you will not be notified if
this device is removed.
\see device_removed()
*/
/*!
\var status_t (*usb_notify_hooks::device_removed)(void *cookie)
\brief Called by the stack in case a device you are using is removed.
If you have accepted a device in the device_added() hook, this hook will
be called as soon as the device is removed.
\param cookie The cookie you provided in the device_added() hook. Make sure
that you free the cookie, if necessary.
\return Currently the return value of this hook is ignored. It is recommended
to return \c B_OK though.
*/
///// usb_support_descriptor /////
/*!
\struct usb_support_descriptor
\brief Description of device descriptor that the driver can handle.
Support descriptors can be used to match any form of class, subclass or
protocol, or a vendor and/or product. If any field has the value \c 0, it
is treated as a wildcard.
For example, if you want to watch for all the hubs, which have a device
class of \c 0x09, you would pass this descriptor:
\code
usb_support_descriptor hub_devs = { 9, 0, 0, 0, 0 };
\endcode
See usb_module_info::register_driver() for more information on how to use
this object.
*/
/*!
\var usb_support_descriptor::dev_class
\brief The supported device classes.
*/
/*!
\var usb_support_descriptor::dev_subclass
\brief The suported device subclasses.
*/
/*!
\var usb_support_descriptor::dev_protocol
\brief The supported device protocols.
*/
/*!
\var usb_support_descriptor::vendor
\brief The supported device vendor.
*/
/*!
\var usb_support_descriptor::product
\brief The supported device products.
*/
///// usb_endpoint_info /////
///// usb_interface_info /////
///// usb_interface_list /////
///// usb_configuration_info /////
///// usb_iso_packet_descriptor /////
///// usb_callback_func /////
/*!
\typedef typedef void (*usb_callback_func)(void *cookie, status_t status, void *data, size_t actualLength)
\brief Callback function for asynchronous transfers.
\param cookie The cookie you supplied when you queued the transfer.
\param status The status of the transfer (whether it succeeded or not).
\param data The provided buffer.
\param actualLength The amount of bytes read or written during the transfer.
*/
///// usb_module_info /////
/*!
\struct usb_module_info
\brief Interface for drivers to interact with Haiku's USB stack.
*/
/*!
\var usb_module_info::binfo
\brief Instance of the bus_manager_info object.
*/
/*!
\fn status_t (*usb_module_info::register_driver)(const char *driverName, const usb_support_descriptor *supportDescriptors, size_t supportDescriptorCount, const char *optionalRepublishDriverName)
\brief Register your driver.
To let the USB stack know that a driver is available to support devices, a
driver needs to register itself first. To let the stack know which devices
it needs to notify the driver of, have a look at usb_support_descriptor.
It is possible to supply a list of support constructors. You should allocate
an array of support constructors, and give the amount of constructors in the
array using the \a supportDescriptorCount parameter.
In case your driver supports all devices, or more likely, in case you want to
monitor all devices plugged in and removed, it is safe to pass \c NULL to the
\a supportDescriptors paramater and zero (0) to \a supportDescriptorCount.
\param driverName A unique name that identifies your driver. Avoid names like
\c webcam or \c mouse, instead use vendor names and device types to avoid
nameclashes. The install_notify() and uninstall_notify() functions use the
driver name as an identifier.
\param supportDescriptors An array of the type usb_support_descriptor. Pass
the amount of objects in the next parameter.
\param supportDescriptorCount The number of objects in the array supplied in
the previous parameter.
\param optionalRepublishDriverName Undocumented parameter. It is safe to
pass \c NULL.
\retval B_OK The driver is registered. You can now call install_notify()
\retval B_BAD_VALUE You passed \c NULL as \a driverName.
\retval B_ERROR General internal error in the USB stack. You may retry the
request in this case.
\retval B_NO_MEMORY Error allocating some internal objects. The system is
out of memory.
*/
/*!
\fn status_t (*usb_module_info::install_notify)(const char *driverName, const usb_notify_hooks *hooks)
\brief Install notify hooks for your driver.
After your driver is registered, you need to pass hooks to your driver that
are called whenever a device that matches your \link usb_support_descriptor
support descriptor \endlink .
As soon as the hooks are installed you'll receive callbacks for devices that
are already attached, so make sure your driver is initialized properly when
calling this method.
\param driverName The name you passed in register_driver().
\param hooks The hooks the stack should call in case the status of devices
that match your support descriptor changes.
\retval B_OK Hooks are installed succesfully.
\retval B_NAME_NOT_FOUND Invalid \a driverName.
\see usb_notify_hooks for information on how your hooks should behave.
\see uninstall_notify()
*/
/*!
\fn status_t (*usb_module_info::uninstall_notify)(const char *driverName)
\brief Uninstall notify hooks for your driver.
If your driver needs to stop, you can uninstall the notifier hooks. This will
clear the stored hooks in the driver and you will not receive any
notifications when new devices are attached. This method will also call
usb_notify_hooks::device_removed() for all the devices that you are using and
all the stack's resources that are allocated to your driver are cleared.
\param driverName The name you passed in register_driver().
\retval B_OK Hooks are uninstalled.
\retval B_NAME_NOT_FOUND Invalid \a driverName.
*/
/*!
\fn const usb_device_descriptor *(*usb_module_info::get_device_descriptor)(usb_device device)
\brief Get the device descriptor.
\param device The id of the device you want to query.
\return The standard usb_device_descriptor, or \c NULL in case of an error.
*/
/*!
\fn const usb_configuration_info *(*usb_module_info::get_nth_configuration)(usb_device device, uint index)
\brief Get a configuration descriptor by index.
\param device The id of the device you want to query.
\param index The (zero based) offset of the list of configurations.
\return The usb_configuration_info with the standard usb configuration
descriptor, or \c NULL if the \a id is invalid or the \a index is out of
bounds.
*/
/*!
\fn const usb_configuration_info *(*usb_module_info::get_configuration)(usb_device device)
\brief Get the current configuration.
\param id The id of the device you want to query.
\retval The usb_configuration_info with the standard usb configuration
descriptor, or \c NULL if the \a id is invalid.
*/
/*!
\fn status_t (*usb_module_info::set_configuration)(usb_device device, const usb_configuration_info *configuration)
\brief Change the current configuration.
Changing the configuration will destroy all the current endpoints. If the
\a configuration points to the current configuration, the request will be
ignored and \c B_OK will be returned.
\param device The id of the device you want to query.
\param configuration The pointer to the new configuration you want to set.
\retval B_OK The new configuration is set succesfully.
\retval B_DEV_INVALID_PIPE The \a device parameter is invalid.
\retval B_BAD_VALUE The configuration does not exist.
\note This method also allows you to completely unconfigure the device, which
means that all the current endpoints, pipes and transfers will be freed.
Pass \c NULL to the parameter \a configuration if you want to do that.
*/
/*!
\fn status_t (*usb_module_info::set_alt_interface)(usb_device device, const usb_interface_info *interface)
\brief Set an alternative interface. Not implemented.
This method currently always returns \c B_ERROR.
*/
/*!
\fn status_t (*usb_module_info::set_feature)(usb_id handle, uint16 selector)
\brief Convenience function for standard control pipe set feature requests.
Both the set_feature() and clear_feature() requests work on all the Stack's
objects: devices, interfaces and pipes.
\param handle The object you want to query.
\param selector The value you want to pass in the feature request.
\return \c B_OK in case the request succeeded and the device responded
positively, or an error code in case it failed.
*/
/*!
\fn status_t (*usb_module_info::clear_feature)(usb_id handle, uint16 selector)
\brief Convenience function for standard control pipe clear feature requests.
\see set_feature() to see how this method works.
*/
/*!
\fn status_t (*usb_module_info::get_status)(usb_id handle, uint16 *status)
\brief Convenience function for standard usb status requests.
\param[in] handle The object you want to query.
\param[out] status A variable in which the device can store it's status.
\return \c B_OK in case the request succeeded and the device responded
positively, or an error code in case it failed.
*/
/*!
\fn status_t (*usb_module_info::get_descriptor)(usb_device device, uint8 descriptorType, uint8 index, uint16 languageID, void *data, size_t dataLength, size_t *actualLength)
\brief Convenience function to get a descriptor from a device.
\param[in] device The device you want to query.
\param[in] descriptorType The type of descriptor you are requesting.
\param[in] index In case there are multiple descriptors of this type, you
select which one you want.
\param[in] languageID The language you want the descriptor in (if applicable,
like with string_descriptors).
\param[out] data The buffer in which the descriptor can be written.
\param[in] dataLength The size of the buffer (in bytes).
\param[out] actualLength A pointer to a variable in which the actual number
of bytes written can be stored.
\retval B_OK The request succeeded, and the descriptor is written.
\retval B_DEV_INVALID_PIPE Invalid \a device parameter.
\retval "other errors" Request failed.
*/
/*!
\fn status_t (*usb_module_info::send_request)(usb_device device, uint8 requestType, uint8 request, uint16 value, uint16 index, uint16 length, void *data, size_t *actualLength)
\brief Send a generic, synchronous request over the default control pipe.
See queue_request() for an asynchronous version of this method.
Most of the standard values of a request are defined in USB_spec.h.
\param[in] device The device you want to query.
\param[in] requestType The request type.
\param[in] request The request you want to perform.
\param[in] value The value of the request.
\param[in] index The index for the request.
\param[in] length The size of the buffer pointed by \a data
\param[out] data The buffer where to put the result in.
\param[out] actualLength The actual numbers of bytes written.
\retval B_OK The request succeeded.
\retval B_DEV_INVALID_PIPE Invalid \a device parameter.
\retval "other errors" Request failed.
*/
/*!
\fn status_t (*usb_module_info::queue_interrupt)(usb_pipe pipe, void *data, size_t dataLength, usb_callback_func callback, void *callbackCookie)
\brief Asynchronously queue an interrupt transfer.
\param pipe The id of the pipe you want to query.
\param data The data buffer you want to pass.
\param dataLength The size of the data buffer.
\param callback The callback function the stack should call after finishing.
\param callbackCookie A cookie that will be supplied to your callback
function when the transfer is finished.
\return Whether or not the queueing of the transfer went well. The return
value won't tell you if the transfer actually succeeded.
\retval B_OK The interrupt transfer is queued.
\retval B_NO_MEMORY Error allocating objects.
\retval B_DEV_INVALID_PIPE The \a pipe is invalid.
*/
/*!
\fn status_t (*usb_module_info::queue_bulk)(usb_pipe pipe, void *data, size_t dataLength, usb_callback_func callback, void *callbackCookie)
\brief Asynchronously queue a bulk transfer.
This method behaves like the queue_interrupt() method, except that it queues
a bulk transfer.
*/
/*!
\fn status_t (*usb_module_info::queue_bulk_v)(usb_pipe pipe, iovec *vector, size_t vectorCount, usb_callback_func callback, void *callbackCookie)
\brief Asynchronously queue a bulk vector.
This method behaves like the queue_interrupt() method, except that it queues
bulk transfers and that it is based on an (array of) io vectors.
\param vector One or more io vectors. IO vectors are standard POSIX entities.
\param vectorCount The number of elements in the \a vector array.
*/
/*!
\fn status_t (*usb_module_info::queue_isochronous)(usb_pipe pipe, void *data, size_t dataLength, usb_iso_packet_descriptor *packetDesc, uint32 packetCount, uint32 *startingFrameNumber, uint32 flags, usb_callback_func callback, void *callbackCookie)
\brief Asynchronously queue a isochronous transfer. Not implemented.
Not implemented in the current Haiku USB Stack.
*/
/*!
\fn status_t (*usb_module_info::queue_request)(usb_device device, uint8 requestType, uint8 request, uint16 value, uint16 index, uint16 length, void *data, usb_callback_func callback, void *callbackCookie)
\brief Asynchronously queue a control pipe request.
This method does roughly the same as send_request(), however, it works
asynchronously. This means that the method will return as soon as the
transfer is queued.
\param callback The callback function for when the transfer is done.
\param callbackCookie The cookie that the stack should pass to your callback
function.
\return Whether or not the queueing of the transfer went well. The return
value won't tell you if the transfer actually succeeded.
\retval B_OK The control transfer is queued.
\retval B_NO_MEMORY Error allocating objects.
\retval B_DEV_INVALID_PIPE The \a callback is invalid.
*/
/*!
\fn status_t (*usb_module_info::set_pipe_policy)(usb_pipe pipe, uint8 maxNumQueuedPackets, uint16 maxBufferDurationMS, uint16 sampleSize)
\brief Set some pipe features.
The USB standard specifies some properties that should be able to be set on
isochronous pipes. If your driver requires the properties to be changed, you
should use this method.
\param pipe The id of the isochronous pipe you want to alter.
\param maxNumQueuedPackets The maximum number of queued packets allowed on
this pipe.
\param maxBufferDurationMS The maximum time in ms that the buffers are valid.
\param sampleSize The size of the samples through this pipe.
\retval B_OK Pipe policy changed.
\retval B_DEV_INVALID_PIPE The \a pipe argument is invalid or not an
isochronous pipe.
*/
/*!
\fn status_t (*usb_module_info::cancel_queued_transfers)(usb_pipe pipe)
\brief Cancel pending transfers. Not Implemented.
Call this method to cancel pending transfers in a \a pipe.
\warning This is currently not implemented!
\param pipe The id of the pipe to clear. The method will always return
\c B_ERROR.
*/
/*!
\fn status_t (*usb_module_info::usb_ioctl)(uint32 opcode, void *buffer, size_t bufferSize)
\brief Low level commands to the USB stack.
This method is used to give lowlevel commands to the Stack. There are
currently no uses documented.
*/
+296
View File
@@ -0,0 +1,296 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/os/drivers/USB_spec.h rev 19915
*/
/*!
\file USB_spec.h
\brief General definitions as defined by the USB standard.
*/
/*!
\name Request Types: targets and direction
These request types can be used in the usb_module_info::send_request()
and usb_module_info::queue_request() methods. They specifiy both the type
of interface and the direction of the transfer.
These are usually combined with a category (found on this page).
*/
//! @{
/*!
\def USB_REQTYPE_DEVICE_IN
\brief Device. In.
*/
/*!
\def USB_REQTYPE_DEVICE_OUT
\brief Device. Out.
*/
/*!
\def USB_REQTYPE_INTERFACE_IN
\brief Interface. In.
*/
/*!
\def USB_REQTYPE_INTERFACE_OUT
\brief Interface. Out.
*/
/*!
\def USB_REQTYPE_ENDPOINT_IN
\brief Endpoint. In.
*/
/*!
\def USB_REQTYPE_ENDPOINT_OUT
\brief Endpoint. Out.
*/
/*!
\def USB_REQTYPE_OTHER_OUT
\brief Other. Out.
*/
/*!
\def USB_REQTYPE_OTHER_IN
\brief Other. In.
*/
//! @}
/*!
\name Request Types: categories
These request types can be used in the usb_module_info::send_request()
and usb_module_info::queue_request() methods. They specifiy the category
of the transfer.
These are usually combined with a target and direction (found on this page).
*/
//! @{
/*!
\def USB_REQTYPE_STANDARD
\brief Request that adheres to the USB specifications.
*/
/*!
\def USB_REQTYPE_CLASS
\brief Request that adheres to the specifications of the class.
*/
/*!
\def USB_REQTYPE_VENDOR
\brief Request that is defined by the specifications of the vendor.
*/
/*!
\def USB_REQTYPE_RESERVED
\brief Reserved for special implementations.
*/
/*!
\def USB_REQTYPE_MASK
\brief Constant that can be used as mask over the requesttype field.
*/
//! @}
/*!
\name Standard Request Values
These request values are defined by the USB standard. You can use these
constants in both the usb_module_info::send_request() and
usb_module_info::queue_request() methods.
\warning The stack handles most of these standard requests for you. Use the
supplied convenience functions the the usb_module_info interface rather than
doing the requests yourself. Some of these request may actually interfere
with the inner workings of the USB stack!
*/
//! @{
/*!
\def USB_REQUEST_GET_STATUS
\brief Get the status of a device.
*/
/*!
\def USB_REQUEST_CLEAR_FEATURE
\brief Clear a feature.
*/
/*!
\def USB_REQUEST_SET_FEATURE
\brief Set a feature.
*/
/*!
\def USB_REQUEST_SET_ADDRESS
\brief Set the device address.
*/
/*!
\def USB_REQUEST_GET_DESCRIPTOR
\brief Get a descriptor.
*/
/*!
\def USB_REQUEST_SET_DESCRIPTOR
\brief Update a descriptor to a supplied one.
*/
/*!
\def USB_REQUEST_GET_CONFIGURATION
\brief Get a configuration.
*/
/*!
\def USB_REQUEST_SET_CONFIGURATION
\brief Set the configuration.
*/
/*!
\def USB_REQUEST_GET_INTERFACE
\brief Request an interface descriptor.
*/
/*!
\def USB_REQUEST_SET_INTERFACE
\brief Set a specific interface.
*/
/*!
\def USB_REQUEST_SYNCH_FRAME
\brief Synchronize a frame.
*/
//! @}
/*!
\name Descriptor Constants
These constants refer to a specific descriptor. They can be used when
building a standard USB request for a descriptor, or in the
usb_module_info::get_descriptor() method.
*/
//! @{
/*!
\def USB_DESCRIPTOR_DEVICE
\brief Constant for the device descriptor.
*/
/*!
\def USB_DESCRIPTOR_CONFIGURATION
\brief Constant for a configuration descriptor.
*/
/*!
\def USB_DESCRIPTOR_STRING
\brief Constant for a string descriptor.
*/
/*!
\def USB_DESCRIPTOR_INTERFACE
\brief Constant for an interface descriptor.
*/
/*!
\def USB_DESCRIPTOR_ENDPOINT
\brief Constant for an endpoint descriptor.
*/
//! @}
/*!
\name Feature Requests
These constants refer to standard feature requests. You can use these using
the convenient usb_module_info::set_feature() and
usb_module_info::clear_feature() methods.
*/
//! @{
/*!
\def USB_FEATURE_DEVICE_REMOTE_WAKEUP
\brief Request a device to wakeup from remote calls.
*/
/*!
\def USB_FEATURE_ENDPOINT_HALT
\brief Request for a specific endpoint to halt.
*/
//! @}
/*!
\name Endpoint Attributes
These constants refer to values in the usb_endpoint_descriptor::attributes
field.
*/
//! @{
/*!
\def USB_ENDPOINT_ATTR_CONTROL
\brief Endpoint facilitates control transfers.
*/
/*!
\def USB_ENDPOINT_ATTR_ISOCHRONOUS
\brief Endpoint facilitates isochronous transfers.
*/
/*!
\def USB_ENDPOINT_ATTR_BULK
\brief Endpoint facilitates bulk transfers.
*/
/*!
\def USB_ENDPOINT_ATTR_INTERRUPT
\brief Endpoint facilitates interrupt transfers.
*/
/*!
\def USB_ENDPOINT_ATTR_MASK
\brief Constant to mask out transfer types.
*/
//! @}
/*!
\name Endpoint Address
These constants refer to the direction that is embedded in the
usb_endpoint_descriptor::address field.
*/
//! @{
/*!
\def USB_ENDPOINT_ADDR_DIR_IN
\brief The endpoint provides data for the driver.
*/
/*!
\def USB_ENDPOINT_ADDR_DIR_OUT
\brief The endpoint accepts data from the host.
*/
//! @}
+1
View File
@@ -4,5 +4,6 @@
\section topics Topics \section topics Topics
- \ref fs_modules - \ref fs_modules
- \ref usb_modules
*/ */
+1 -1
View File
@@ -325,7 +325,7 @@ with the user's access permissions, the function shall return \c B_OK.
For most FSs the permissions a user has are defined by the \c st_mode, For most FSs the permissions a user has are defined by the \c st_mode,
\c st_uid, and \c st_gid fields of the node's stat data. As a special \c st_uid, and \c st_gid fields of the node's stat data. As a special
exception, the root user (<tt>geteuid() == 0<\tt>) does always have exception, the root user (<tt>geteuid() == 0</tt>) does always have
read and write permissions, execution permission only when at least one of the read and write permissions, execution permission only when at least one of the
execution permission bits are set. execution permission bits are set.
+18
View File
@@ -0,0 +1,18 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
*/
/*!
\page usb_modules Writing drivers for USB devices
This page will describe how the Haiku USB stack is structured.
*/
+5 -5
View File
@@ -287,12 +287,12 @@ More about the Midi Kit:
- \ref Midi2Defs.h - \ref Midi2Defs.h
- Be Newsletter Volume 3, Issue 47 - Motor Mix sample code - Be Newsletter Volume 3, Issue 47 - Motor Mix sample code
- Be Newsletter Volume 4, Issue 3 - Overview of the new kit - Be Newsletter Volume 4, Issue 3 - Overview of the new kit
- <A HREF="http://open-beos.sourceforge.net/nsl.php?mode=display&id=33">OpenBeOS - <A HREF="http://haiku-os.org/documents/dev/introduction_to_midi_part_1">Newsletter
Newsletter 33</A>, Introduction to MIDI, Part 1 33</A>, Introduction to MIDI, Part 1
- <A HREF="http://open-beos.sourceforge.net/nsl.php?mode=display&id=36">OpenBeOS - <A HREF="http://haiku-os.org/documents/dev/introduction_to_midi_part_2">Newsletter
Newsletter 36</A>, Introduction to MIDI, Part 2 36</A>, Introduction to MIDI, Part 2
- Sample code and other goodies at the - Sample code and other goodies at the
<A HREF="http://open-beos.sourceforge.net/tms/team.php?id=13">OpenBeOS Midi Kit team page</A> <A HREF="http://haiku-os.org/about/teams/midi_kit">Haiku Midi Kit team page</A>
Information about MIDI in general: Information about MIDI in general:
+172
View File
@@ -0,0 +1,172 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/os/support/Archivable.h rev 19972
* /trunk/src/kits/support/Archivable.cpp rev 19095
*/
/*!
\file Archivable.h
\brief Provides the BArchivable interface.
*/
/*!
\class BArchivable
\ingroup support
\ingroup libbe
\brief Interfaced for objects that can be archived into a BMessage.
BArchivable provides an interface for objects that can be archived into
messages and unarchived to objects in another location. By these means you
are able to send objects between applications, or even between computers over
networks.
BArchivable differs from BFlattenable in way that BFlattenable is designed to
store objects to flat streams of data, where the main objective is storing it
to disk. The objective of this interface is to archive objects that will be
restored as objects. To illustrate that point, BArchivable messages know how
to restore itself, whereas BFlattenables have a datatype which you manually
need to map to classes.
Archiving is done with the Archive() method. If your class support it, the
caller can request your class to to a deep archivation, which means that all
child objects should be stored. Unarchiving works with the Instantiate()
method, which is static. However, since the interface is designed to
unarchive objects without the caller knowing what kind of object it
actually is, the global function #instantiate_object() instantiates a message
without you manually having to determine the class the message is from. This
adds considerable flexibility and allows BArchivable to be used in
combination with add-ons.
To provide this interface in your classes, you should publicly inherit this
class. You should reimplement Archive() and Instantiate(), and provide one
constructor that takes one BMessage argument.
*/
/*!
\fn BArchivable::BArchivable(BMessage* from)
\brief Constructor. Does nothing.
If you inherit this interface, you should at least provide one constructor
that takes one BMessage argument.
*/
/*!
\fn BArchivable::BArchivable()
\brief Constructor. Does nothing.
*/
/*!
\fn BArchivable::~BArchivable()
\brief Destructor. Does nothing.
*/
/*!
\fn virtual status_t BArchivable::Archive(BMessage* into, bool deep = true) const
\brief Archive the object into a BMessage.
You should call this method from your derived implementation, as it finishes
the message to contain data to instantiate your object.
\param into The message you may store your object in.
\param deep If \c true, all child object of this object should be stored as
well. Naturally, only pay attention of this parameter if you actually have
child objects.
\retval B_OK The archiving succeeded.
\retval "error codes" The archiving did not succeed.
*/
/*!
\fn static BArchivable* BArchivable::Instantiate(BMessage* archive)
\brief Static member to restore objects from messages.
You should always check that the \a archive argument actually corresponds to
your class. The automatic functions, such as #instantiate_object() will not
choose the wrong class, but some manual calls to this member might be faulty.
\param archive The message with the data to restore an object.
\retval You should return a pointer to your object, or \c NULL if you
failed to succeed.
\warning The default implementation will always return \c NULL. Even though
it is possible to store plain BArchive objects, it is impossible to restore
them.
\see instantiate_object(BMessage *from)
*/
/*!
\fn virtual status_t BArchivable::Perform(perform_code d, void* arg)
\brief Internal method.
\internal This method is used to extend the API or to provide 'hidden'
features. Currently nothing of interest is implemented.
*/
///////////////////// Global methods
/*!
\addtogroup support_globals
@{
*/
/*!
\typedef typedef BArchivable* (*instantiation_func)(BMessage*)
\brief Internal definition of a function that can instantiate objects that
have been created with the BArchivable API.
*/
/*!
\fn BArchivable* instantiate_object(BMessage *from, image_id *id)
\brief Instantiate an archived object with the object being defined in a
different application or library.
This function is similar to instantiate_object(BMessage *from), except that
it takes the \a id argument that refers to an image where the object might
come from.
\note Images are names for executable files. Image ids refer to these
executable files that have been loaded by your application. Have a look
at the kernel API.
*/
/*!
\fn BArchivable* instantiate_object(BMessage *from)
\brief Instantiate an archived object.
This global function will determine the base class based on the \a from
argument, and it will call the Instantiate() function of that object to
restore it.
\param from The archived object.
\return The object returns a pointer to the instantiated object, or \c NULL
if the instantiation failed. The global \c errno variable will contain the
reason it failed.
\see instantiate_object(BMessage *from, image_id *id)
*/
/*!
\fn bool validate_instantiation(BMessage* from, const char* className)
\brief Internal function that checks if the \a className is the same as the
one stored in the \a from message.
*/
/*!
\fn instantiation_func find_instantiation_func(const char* className, const char* signature)
\brief Internal function that searches for the instantiation func with a
specific signature. Use instantiate_object() instead.
*/
/*!
\fn instantiation_func find_instantiation_func(const char* className)
\brief Internal function that searches for the instantiation func of a
specific class. Use instantiate_object() instead.
*/
/*!
\fn instantiation_func find_instantiation_func(BMessage* archive)
\brief Internal function that searches for the instantiation func that
works on the specified \a archive. Use instantiate_object() instead.
*/
//! @}
+11
View File
@@ -1,3 +1,13 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/os/support/Autolock.h rev 19972
*/
/*! /*!
\file Autolock.h \file Autolock.h
\brief Implements a handy locking utility. \brief Implements a handy locking utility.
@@ -44,6 +54,7 @@ Receiver::HandleCall(Call *call)
\endcode \endcode
With the BAutolock this example can be rewritten as follows: With the BAutolock this example can be rewritten as follows:
\code \code
status_t status_t
Receiver::HandleCall(Call *call) Receiver::HandleCall(Call *call)
+29 -4
View File
@@ -1,3 +1,18 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/os/support/Beep.h rev 19972
* /trunk/src/kits/support/Beep.cpp rev 20711
*/
/////!!!!!! Note that the workings of the beep still aren't completely clear
///// and not completely implemented, so this needs revision if everything
///// is finished.
/*! /*!
\file Beep.h \file Beep.h
\brief Functions to generate sounds from the computer. \brief Functions to generate sounds from the computer.
@@ -5,28 +20,38 @@
/*! /*!
\addtogroup support_globals \addtogroup support_globals
@{
*/ */
//! @{
/*! /*!
\fn status_t beep() \fn status_t beep()
\brief TODO: Not implemented nor documented. \brief Invoke the standard system beep to alert users.
From Beep.h and in libbe.so. From Beep.h and in libbe.so.
\see system_beep() and add_system_beep_event()
*/ */
/*! /*!
\fn status_t system_beep(const char* eventName) \fn status_t system_beep(const char* eventName)
\brief TODO: Not implemented nor documented. \brief Invokes the sound for event \a eventName.
You can add the events using add_system_beep_event().
From Beep.h and in libbe.so. From Beep.h and in libbe.so.
*/ */
/*! /*!
\fn status_t add_system_beep_event(const char* eventName, uint32 flags = 0) \fn status_t add_system_beep_event(const char* eventName, uint32 flags = 0)
\brief TODO: Not implemented nor documented. \brief Adds an event to the media server.
Call this method to add a specific event to the media server.
From Beep.h and in libbe.so. From Beep.h and in libbe.so.
\param eventName The name of the event.
\param flags Currently unused. Pass \c 0.
*/ */
//! @} //! @}
+31 -18
View File
@@ -1,3 +1,14 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/os/support/BlockCache.h rev 19972
* /trunk/src/kits/support/BlockCache.cpp rev 4568
*/
/*! /*!
\file BlockCache.h \file BlockCache.h
\brief Implements a mechanism to store and retrieve memory blocks \brief Implements a mechanism to store and retrieve memory blocks
@@ -62,11 +73,12 @@ the objects itself.
\fn BBlockCache::BBlockCache(uint32 blockCount, size_t blockSize, uint32 allocationType) \fn BBlockCache::BBlockCache(uint32 blockCount, size_t blockSize, uint32 allocationType)
\brief Allocate a new memory pool. \brief Allocate a new memory pool.
\param blockCount The number of free memory blocks you want to initially allocate. \param blockCount The number of free memory blocks you want to initially
This number is also used as a maximum number of free blocks that will be kept. allocate. This number is also used as a maximum number of free blocks that
will be kept.
\param blockSize The size of the blocks. \param blockSize The size of the blocks.
\param allocationType Either #B_OBJECT_CACHE for using \c new[] and \c delete[] \param allocationType Either #B_OBJECT_CACHE for using \c new[] and
or #B_MALLOC_CACHE for \c malloc() and \c free(). \c delete[] or #B_MALLOC_CACHE for \c malloc() and \c free().
*/ */
/*! /*!
@@ -74,18 +86,18 @@ the objects itself.
\brief Destroy the empty blocks in the free list. \brief Destroy the empty blocks in the free list.
Note that the blocks you checked out with Get() and not checked back in with Note that the blocks you checked out with Get() and not checked back in with
Save() will not be freed, since ownership belongs to you. Make sure you clean up Save() will not be freed, since ownership belongs to you. Make sure you clean
after yourself. up after yourself.
*/ */
/*! /*!
\fn void *BBlockCache::Get(size_t blockSize) \fn void *BBlockCache::Get(size_t blockSize)
\brief Get a block from the pool of free blocks. \brief Get a block from the pool of free blocks.
If the pool runs out of free blocks, a new one will be allocated. Please note that If the pool runs out of free blocks, a new one will be allocated. Please note
if the size given in the \c blockSize parameter is different from the size given that if the size given in the \c blockSize parameter is different from the
in the constructor, that a new block of memory will be created. Only sizes that size given in the constructor, that a new block of memory will be created.
match the blocks in the memory pool will come from the pool. Only sizes that match the blocks in the memory pool will come from the pool.
\param blockSize The required size of the memory block. \param blockSize The required size of the memory block.
\return Returns a pointer to a memory block, or \c NULL if locking the object \return Returns a pointer to a memory block, or \c NULL if locking the object
@@ -96,13 +108,14 @@ failed.
\fn void BBlockCache::Save(void *pointer, size_t blockSize) \fn void BBlockCache::Save(void *pointer, size_t blockSize)
\brief Save a block of memory to the memory pool. \brief Save a block of memory to the memory pool.
The block of memory will only be added to the pool if the \c blockSize is equal The block of memory will only be added to the pool if the \c blockSize is
to the size the object was created with, and if the maximum number free blocks equal to the size the object was created with, and if the maximum number
in the list won't be passed. Else the memory will be freeed. free blocks in the list won't be passed. Else the memory will be freeed.
Note that it is perfectly valid to pass objects other than you got from Get(), but Note that it is perfectly valid to pass objects other than you got from
please note that the way it was created confirms with the way memory is allocated Get(), but please note that the way it was created confirms with the way
and freed in this pool. Thus, only feed blocks that were created with \c new[] if memory is allocated and freed in this pool. Thus, only feed blocks that were
the allocation type is #B_OBJECT_CACHE, likewise use only objects allocated created with \c new[] if the allocation type is #B_OBJECT_CACHE, likewise
with \c malloc() when the allocation type is #B_MALLOC_CACHE. use only objects allocated with \c malloc() when the allocation type is
#B_MALLOC_CACHE.
*/ */
+10 -12
View File
@@ -1,15 +1,13 @@
// /*
// Copyright 2007, Haiku Inc. All Rights Reserved. * Copyright 2007, Haiku, Inc. All Rights Reserved.
// * Distributed under the terms of the MIT License.
// Distributed under the terms of the MIT License. *
// * Documentation by:
// * Niels Sascha Reedijk <[email protected]>
// Documentation by: * Corresponds to:
// Niels Sascha Reedijk <[email protected] * /trunk/headers/os/support/List.h rev 19972
// Corresponds to: * /trunk/src/kits/support/List.cpp rev 18649
// /trunk/headers/os/support/List.h rev 19972 */
// /trunk/src/kits/support/List.cpp rev 18649
//
/*! /*!
\file List.h \file List.h
+10
View File
@@ -1,3 +1,13 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/os/support/SupportDefs.h rev 19972
*/
/*! /*!
\file SupportDefs.h \file SupportDefs.h
\ingroup support \ingroup support
+43 -25
View File
@@ -1,3 +1,13 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Axel Dörfler
* Corresponds to:
* /trunk/headers/os/support/parsedate.h rev 19972
*/
/*! /*!
\file parsedate.h \file parsedate.h
\ingroup support \ingroup support
@@ -68,57 +78,64 @@ A blank stands for white space. No other character is allowed.
An invalid format string won't do any harm, but of course, no input string An invalid format string won't do any harm, but of course, no input string
will ever match that format. will ever match that format.
For example, "H:M [p]" will match against "21:33", "4:12 am", but not "30:30 pm" For example, "H:M [p]" will match against "21:33", "4:12 am", but not
(hours out of range), "15:16 GMT" (this time zone is certainly not a valid "30:30 pm" (hours out of range), "15:16 GMT" (this time zone is certainly
meridian specifier), or "4:66" (minutes out of range). not a valid meridian specifier), or "4:66" (minutes out of range).
\par Note: \par Note:
At the time of this writing, the parsedate() functions are not localized and At the time of this writing, the parsedate() functions are not localized and
will only recognize English time specifications following the examples above. will only recognize English time specifications following the examples above.
*/ */
/** \def PARSEDATE_RELATIVE_TIME /*!
\def PARSEDATE_RELATIVE_TIME
\brief relative time \brief relative time
The time value was computed relative to the specified time. The time value was computed relative to the specified time.
*/ */
/** \def PARSEDATE_DAY_RELATIVE_TIME /*!
\def PARSEDATE_DAY_RELATIVE_TIME
\brief day relative time \brief day relative time
The time value was computed relative to the specified time, and it would vary with The time value was computed relative to the specified time, and it would vary
every day passed in the specified time. with every day passed in the specified time.
*/ */
/** \def PARSEDATE_MINUTE_RELATIVE_TIME /*!
\def PARSEDATE_MINUTE_RELATIVE_TIME
\brief minute relative time \brief minute relative time
The time value was computed relative to the specified time, and it would vary with The time value was computed relative to the specified time, and it would
every minute passed in the specified time. vary with every minute passed in the specified time.
*/ */
/** \def PARSEDATE_INVALID_DATE /*!
\def PARSEDATE_INVALID_DATE
\brief invalid date string \brief invalid date string
This flag will be set if the specified date string could not be parsed correctly. This flag will be set if the specified date string could not be parsed
For example, this may happen if there are some unknown words in that string. correctly. For example, this may happen if there are some unknown words in
that string.
*/ */
/** \fn time_t parsedate(const char *dateString, time_t relativeTo) /*!
\brief Parses <span class="var">dateString</span> relative to <span class="var">relativeTo</span> \fn time_t parsedate(const char *dateString, time_t relativeTo)
\brief Parses \a dateString relative to \a relativeTo
Parses the given <span class="var">dateString</span> relative to the time Parses the given \a dateString relative to the time
specified by <span class="var">relativeTo</span> using the internal formats specified by \a relativeTo using the internal formats
table. table.
\param dateString the date that should be parsed, i.e. "next thursday" \param dateString the date that should be parsed, i.e. "next thursday".
\param relativeTo all relative dates will be relative to this time, if -1 is passed, the current time will be used \param relativeTo all relative dates will be relative to this time, if -1
\return the parsed time value or -1 if the <span class="var">dateString</span> is passed, the current time will be used.
\return the parsed time value or -1 if the \a dateString
could not be parsed. could not be parsed.
*/ */
/** \fn time_t parsedate_etc(const char *dateString, time_t relativeTo, int *_storedFlags) /*!
\fn time_t parsedate_etc(const char *dateString, time_t relativeTo, int *_storedFlags)
\brief Parses <span class="var">dateString</span> relative to <span class="var">relativeTo</span> \brief Parses <span class="var">dateString</span> relative to <span class="var">relativeTo</span>
This does basically the same as parsedate(), but will set the following This does basically the same as parsedate(), but will set the following
@@ -145,7 +162,8 @@ flags in <span class="var">_storedFlags</span>:
\endhtmlonly \endhtmlonly
*/ */
/** \fn void set_dateformats(const char *formatTable[]) /*!
\fn void set_dateformats(const char *formatTable[])
\brief sets the internal format table for parsedate() \brief sets the internal format table for parsedate()
This function let you set the format table which is used by parsedate(). This function let you set the format table which is used by parsedate().
@@ -154,10 +172,10 @@ When <span class="var">formatTable</span> is NULL, the standard built-in format
valid when using parsedate() - it is not copied, but directly used. valid when using parsedate() - it is not copied, but directly used.
\see \see
\ref parsedateFormats Format! \ref parsedateFormats Format!
*/ */
/** \fn const char **get_dateformats(void) /*!
\fn const char **get_dateformats(void)
\brief returns the internal format table currently used by parsedate() \brief returns the internal format table currently used by parsedate()
Returns the internal format table currently used by parsedate() - this is Returns the internal format table currently used by parsedate() - this is
+38 -20
View File
@@ -1,3 +1,14 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation written by:
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/os/support/StopWatch.h rev 19972
* /trunk/src/kits/support/StopWatch.cpp rev 14204
*/
/*! /*!
\file StopWatch.h \file StopWatch.h
\brief Provides the BStopWatch class. \brief Provides the BStopWatch class.
@@ -9,16 +20,20 @@
\ingroup libbe \ingroup libbe
\brief A timer class. \brief A timer class.
This class provides method to time events. The interface is designed to behave like a physical stopwatch. It is especially useful for debugging certain parts of your code, since it can behave like a 'cheap' profiler. This class provides method to time events. The interface is designed to
behave like a physical stopwatch. It is especially useful for debugging
certain parts of your code, since it can behave like a 'cheap' profiler.
*/ */
/*! /*!
\fn BStopWatch::BStopWatch(const char *name, bool silent) \fn BStopWatch::BStopWatch(const char *name, bool silent)
\brief Constructs a BStopWatch object and starts the timer. \brief Construct a BStopWatch object and starts the timer.
The constructor creates a clean BStopWatch object. This object The constructor creates a clean BStopWatch object. This object
can be given a name. As soon as the object is created, the time can be given a name. As soon as the object is created, the time
will start ticking away. This class is designed to be usuable as a primitive profiling tool. will start ticking away. This class is designed to be usuable as a primitive
profiling tool.
If you are profiling your code with this class, pass true as the If you are profiling your code with this class, pass true as the
silentparameter. Whenever the object is destroyed, information on silentparameter. Whenever the object is destroyed, information on
the elapsed time will be streamed to standard output. the elapsed time will be streamed to standard output.
@@ -29,36 +44,39 @@ the elapsed time will be streamed to standard output.
/*! /*!
\fn BStopWatch::~BStopWatch() \fn BStopWatch::~BStopWatch()
\brief Destructor.
Destroys the object. If the object was constructed with the parameter Destroys the object. If the object was constructed with the parameter
silent set t to false, this destructor will print silent set t to false, this destructor will print information on the elapsed
information on the elapsed time to standard output. time to standard output.
*/ */
/*! /*!
\fn void BStopWatch::Resume() \fn void BStopWatch::Resume()
\brief Resumes the timer when it is in a suspended state. \brief Resume the timer when it is in a suspended state.
\sa Suspend() \see Suspend()
*/ */
/*! /*!
\fn void BStopWatch::Suspend() \fn void BStopWatch::Suspend()
\brief Suspend the timer. \brief Suspend the timer.
\sa Resume() \see Resume()
*/ */
/*! /*!
\fn bigtime_t BStopWatch::Lap() \fn bigtime_t BStopWatch::Lap()
\brief Start a new lap. \brief Start a new lap.
This method sets a lap. With the current implementation you are unable to actually This method sets a lap. With the current implementation you are unable to
retrieve the timings of the laps. This is only printed to the standard output when the actually retrieve the timings of the laps. This is only printed to the
object is destroyed. Thus making this tool only usuable for use when doing some standard output when the object is destroyed. Thus making this tool only
profiling. usuable for use when doing some profiling.
\attention Please note that the current implementation is limited to 10 laps. The value returned \attention Please note that the current implementation is limited to 10 laps.
is the time that has passed since the timer was started (and not the time that has The value returned is the time that has passed since the timer was started
passed since the last lap). Any lap call beyond the 10th lap will overwrite the last (and not the time that has passed since the last lap). Any lap call beyond
value. Note that if the timer is suspended, nothing happens and the method will return 0. the 10th lap will overwrite the last value. Note that if the timer is
suspended, nothing happens and the method will return 0.
*/ */
/*! /*!
@@ -69,14 +87,14 @@ value. Note that if the timer is suspended, nothing happens and the method will
/*! /*!
\fn void BStopWatch::Reset() \fn void BStopWatch::Reset()
\brief Restart the timer \brief Restart the timer.
Resets the object: it clears the start time, it clears the stored laps and it restarts Resets the object: it clears the start time, it clears the stored laps and it
the timer. restarts the timer.
*/ */
/*! /*!
\fn const char *BStopWatch::Name() const \fn const char *BStopWatch::Name() const
\brief Get the name \brief Get the name.
\return the name given to the object at creation time. \return the name given to the object at creation time.
*/ */
+10 -12
View File
@@ -1,15 +1,13 @@
// /*
// Copyright 2007, Haiku Inc. All Rights Reserved. * Copyright 2007, Haiku, Inc. All Rights Reserved.
// * Distributed under the terms of the MIT License.
// Distributed under the terms of the MIT License. *
// * Documentation by:
// * Niels Sascha Reedijk <[email protected]>
// Documentation by: * Corresponds to:
// Niels Sascha Reedijk <[email protected]> * /trunk/headers/os/support/String.h rev 19731
// Corresponds to: * /trunk/src/kits/support/String.cpp rev 19731
// /trunk/headers/os/support/String.h rev 19731 */
// /trunk/src/kits/support/String.cpp rev 19731
//
/*! /*!
\file String.h \file String.h
-7
View File
@@ -1,7 +0,0 @@
/*!
\page support_archiving Archiving and unarchiving objects.
This document is also in the original BeBook, where it describes:
-# How to archive and unarchive an object
-# How to create an archivable object.
*/
+9 -1
View File
@@ -1,3 +1,11 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
*/
/*! /*!
\page support_intro Introduction to the Support Kit \page support_intro Introduction to the Support Kit
@@ -11,7 +19,7 @@
- BAutolock - BAutolock
- Thread Local Storage - Thread Local Storage
- Archiving and IO: - Archiving and IO:
- BArchivable (\link support_archiving tutorial\endlink) - BArchivable
- BFlattenable - BFlattenable
- BDataIO - BDataIO
- BPositionIO - BPositionIO
+116 -51
View File
@@ -1,3 +1,14 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation written by:
* Axel Dörfler
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/posix/syslog.h rev 6684
*/
/*! /*!
\file syslog.h \file syslog.h
\ingroup support \ingroup support
@@ -9,30 +20,36 @@ that provides the system logging capabilities.
The log can be found in /var/log/syslog. The log can be found in /var/log/syslog.
*/ */
/*! \fn void closelog(void) /*!
\fn void closelog(void)
\brief Closes the current log session \brief Closes the current log session
*/ */
/*! \fn void openlog(const char *ident, int options, int facility) /*!
\fn void openlog(const char *ident, int options, int facility)
\brief Starts a log session, and sets some output options \brief Starts a log session, and sets some output options
Like openlog_thread() this function defines the log session in thread context; the Like openlog_thread() this function defines the log session in thread context; the
global options set by openlog_team() are not affected by this function. global options set by openlog_team() are not affected by this function.
*/ */
/*! \fn int setlogmask(int priorityMask) /*!
\fn int setlogmask(int priorityMask)
\brief sets the logging priority mask \brief sets the logging priority mask
*/ */
/*! \fn void syslog(int priority, const char *message, ...) /*!
\fn void syslog(int priority, const char *message, ...)
\brief sends a message to the system log \brief sends a message to the system log
*/ */
/*! \fn void closelog_team(void) /*!
\fn void closelog_team(void)
\brief Closes the log \brief Closes the log
*/ */
/*! \fn void openlog_team(const char *ident, int logopt, int facility) /*!
\fn void openlog_team(const char *ident, int logopt, int facility)
\brief Starts a log session, and sets some output options \brief Starts a log session, and sets some output options
This function defines the team-wide logging options. Thread local sessions This function defines the team-wide logging options. Thread local sessions
@@ -40,189 +57,237 @@ started with openlog() or openlog_thread() will inherit the options of the
global session. global session.
*/ */
/*! \fn void log_team(int priority, const char *message, ...) /*!
\fn void log_team(int priority, const char *message, ...)
\brief sends a message to the system log \brief sends a message to the system log
*/ */
/*! \fn int setlogmask_team(int priorityMask) /*!
\fn int setlogmask_team(int priorityMask)
\brief sets the logging priority mask \brief sets the logging priority mask
*/ */
/*! \fn void closelog_thread(void) /*!
\fn void closelog_thread(void)
\brief Closes the log \brief Closes the log
*/ */
/*! \fn void openlog_thread(const char *ident, int logopt, int facility) /*!
\fn void openlog_thread(const char *ident, int logopt, int facility)
\brief Starts a log session, and sets some output options \brief Starts a log session, and sets some output options
*/ */
/*! \fn void log_thread(int priority, const char *message, ...) /*!
\fn void log_thread(int priority, const char *message, ...)
\brief sends a message to the system log \brief sends a message to the system log
*/ */
/*! \fn int setlogmask_thread(int priorityMask) /*!
\fn int setlogmask_thread(int priorityMask)
\brief sets the logging priority mask \brief sets the logging priority mask
*/ */
/*! @{ /*!
\name Options for openlog() \name Options for openlog()
*/ */
/*! \def LOG_PID //! @{
/*!
\def LOG_PID
\brief Log the process (thread/team) ID with each message \brief Log the process (thread/team) ID with each message
*/ */
/*! \def LOG_CONS /*!
\def LOG_CONS
\brief Log to the system console on error \brief Log to the system console on error
*/ */
/*! \def LOG_ODELAY /*!
\def LOG_ODELAY
\brief Delay open until syslog() is called \brief Delay open until syslog() is called
*/ */
/*! \def LOG_NDELAY /*!
\def LOG_NDELAY
\brief Connect to the syslog daemon immediately \brief Connect to the syslog daemon immediately
*/ */
/*! \def LOG_SERIAL /*!
\def LOG_SERIAL
\brief Dump to serial output as well. \brief Dump to serial output as well.
\attention This is not yet implemented \attention This is not yet implemented
*/ */
/*! \def LOG_PERROR /*!
\def LOG_PERROR
\brief Dump to stderr as well \brief Dump to stderr as well
*/ */
/*! \def LOG_NOWAIT /*!
\def LOG_NOWAIT
\brief Do not wait for child processes \brief Do not wait for child processes
*/ */
//! @} //! @}
/*! @{ /*!
\name Facilities for openlog() \name Facilities for openlog()
*/ */
/*! \def LOG_KERN //! @{
/*!
\def LOG_KERN
\brief Reserved for messages generated by the kernel. \brief Reserved for messages generated by the kernel.
*/ */
/*! \def LOG_USER /*!
\def LOG_USER
\brief Reserved for messages generated by user processes. \brief Reserved for messages generated by user processes.
*/ */
/*! \def LOG_MAIL /*!
\def LOG_MAIL
\brief Standard (?) POSIX facility for messages by the mailing daemon. \brief Standard (?) POSIX facility for messages by the mailing daemon.
*/ */
/*! \def LOG_DAEMON /*!
\def LOG_DAEMON
\brief Standard POSIX (?) facility for messages by daemons (and Haiku servers). \brief Standard POSIX (?) facility for messages by daemons (and Haiku servers).
*/ */
/*! \def LOG_AUTH /*!
\def LOG_AUTH
\brief Standard POSIX facility(?) for messages by the authentication services. \brief Standard POSIX facility(?) for messages by the authentication services.
*/ */
/*! \def LOG_SYSLOG /*!
\def LOG_SYSLOG
\brief Reserved for messages generated by the syslog daemon. \brief Reserved for messages generated by the syslog daemon.
*/ */
/*! \def LOG_LPR /*!
\def LOG_LPR
\brief Reserved for messages generated by the UNIX lpr printing tool. \brief Reserved for messages generated by the UNIX lpr printing tool.
*/ */
/*! \def LOG_NEWS /*!
\def LOG_NEWS
\brief Reserved for messages generated by something UNIXy that does something with NEWS. \brief Reserved for messages generated by something UNIXy that does something with NEWS.
*/ */
/*! \def LOG_UUCP /*!
\def LOG_UUCP
\brief Reserved for messages generated by UUCP \brief Reserved for messages generated by UUCP
*/ */
/*! \def LOG_CRON /*!
\def LOG_CRON
\brief Reserved for messages generated by the CRON daemon. \brief Reserved for messages generated by the CRON daemon.
*/ */
/*! \def LOG_AUTHPRIV /*!
\def LOG_AUTHPRIV
\brief Reserved for private (?) messages that relate to authentication. \brief Reserved for private (?) messages that relate to authentication.
*/ */
/*! \def LOG_LOCAL0 /*!
\def LOG_LOCAL0
\brief Use this for local use. \brief Use this for local use.
*/ */
/*! \def LOG_LOCAL1 /*!
\def LOG_LOCAL1
\brief Use this for local use. \brief Use this for local use.
*/ */
/*! \def LOG_LOCAL2 /*!
\def LOG_LOCAL2
\brief Use this for local use. \brief Use this for local use.
*/ */
/*! \def LOG_LOCAL3 /*!
\def LOG_LOCAL3
\brief Use this for local use. \brief Use this for local use.
*/ */
/*! \def LOG_LOCAL4 /*!
\def LOG_LOCAL4
\brief Use this for local use. \brief Use this for local use.
*/ */
/*! \def LOG_LOCAL5 /*!
\def LOG_LOCAL5
\brief Use this for local use. \brief Use this for local use.
*/ */
/*! \def LOG_LOCAL6 /*!
\def LOG_LOCAL6
\brief Use this for local use. \brief Use this for local use.
*/ */
/*! \def LOG_LOCAL7 /*!
\def LOG_LOCAL7
\brief Use this for local use. \brief Use this for local use.
*/ */
//! @} //! @}
/*! @{ /*!
\name Priorities for syslog(), log_team() and log_thread() \name Priorities for syslog(), log_team() and log_thread()
*/ */
/*! \def LOG_EMERG //! @{
/*!
\def LOG_EMERG
\brief A panic condition \brief A panic condition
*/ */
/*! \def LOG_PANIC /*!
\def LOG_PANIC
\brief An alias for LOG_EMERG \brief An alias for LOG_EMERG
*/ */
/*! \def LOG_ALERT /*!
\def LOG_ALERT
\brief A condition to that should be corrected immediately \brief A condition to that should be corrected immediately
*/ */
/*! \def LOG_CRIT /*!
\def LOG_CRIT
\brief Critical conditions like hard drive errors \brief Critical conditions like hard drive errors
*/ */
/*! \def LOG_ERR /*!
\def LOG_ERR
\brief Errors \brief Errors
*/ */
/*! \def LOG_WARNING /*!
\def LOG_WARNING
\brief Warnings \brief Warnings
*/ */
/*! \def LOG_NOTICE /*!
\def LOG_NOTICE
\brief Notices, instructions on how to use certain configuration options. \brief Notices, instructions on how to use certain configuration options.
*/ */
/*! \def LOG_INFO /*!
\def LOG_INFO
\brief Information, like versions and so. \brief Information, like versions and so.
*/ */
/*! \def LOG_DEBUG /*!
\def LOG_DEBUG
\brief Debug information. \brief Debug information.
*/\ */\
//! @} //! @}
/*! \def LOG_MASK /*!
\def LOG_MASK
\brief Converts a priority definition for use in setlogmask() \brief Converts a priority definition for use in setlogmask()
*/ */
+13 -1
View File
@@ -1,3 +1,13 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Documentation by:
* Niels Sascha Reedijk <[email protected]>
* Corresponds to:
* /trunk/headers/os/support/TypeConstants.h rev 20212
*/
/*! /*!
\file TypeConstants.h \file TypeConstants.h
\ingroup support \ingroup support
@@ -106,10 +116,12 @@ anyway.
// Todo: the rest of the types // Todo: the rest of the types
/*! @{ /*!
\name System-wide MIME types for handling URLs \name System-wide MIME types for handling URLs
*/ */
//! @{
/*! /*!
\var B_URL_HTTP \var B_URL_HTTP
\brief application/x-vnd.Be.URL.http \brief application/x-vnd.Be.URL.http