Commit 15ef0ef6 authored by Havoc Pennington's avatar Havoc Pennington

2006-10-19 Havoc Pennington <hp@redhat.com>

	* Fix a pile of Doxygen warnings and missing docs
parent fe1f793a
2006-10-19 Havoc Pennington <hp@redhat.com>
* Fix a pile of Doxygen warnings and missing docs
2006-10-19 John (J5) Palmieri <johnp@redhat.com>
* bus/dir-watch-default.c, bus/dir-watch-dnotify.c,
......
......@@ -49,8 +49,20 @@ struct DBusAddressEntry
};
/**
*
* Sets #DBUS_ERROR_BAD_ADDRESS.
* If address_problem_type and address_problem_field are not #NULL,
* sets an error message about how the field is no good. Otherwise, sets
* address_problem_other as the error message.
*
* @param error the error to set
* @param address_problem_type the address type of the bad address or #NULL
* @param address_problem_field the missing field of the bad address or #NULL
* @param address_problem_other any other error message or #NULL
*/
void
_dbus_set_bad_address (DBusError *error,
_dbus_set_bad_address (DBusError *error,
const char *address_problem_type,
const char *address_problem_field,
const char *address_problem_other)
......@@ -65,6 +77,10 @@ _dbus_set_bad_address (DBusError *error,
address_problem_other);
}
/**
* #TRUE if the byte need not be escaped when found in a dbus address.
* All other bytes are required to be escaped in a valid address.
*/
#define _DBUS_ADDRESS_OPTIONALLY_ESCAPED_BYTE(b) \
(((b) >= 'a' && (b) <= 'z') || \
((b) >= 'A' && (b) <= 'Z') || \
......@@ -615,6 +631,9 @@ dbus_address_unescape_value (const char *value,
/** @} */ /* End of public API */
#ifdef DBUS_BUILD_TESTS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include "dbus-test.h"
#include <stdlib.h>
......@@ -782,4 +801,6 @@ _dbus_address_test (void)
return TRUE;
}
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
#endif
......@@ -373,18 +373,18 @@ _dbus_connection_queue_received_message (DBusConnection *connection,
* variable pointer
*/
void
_dbus_connection_test_get_locks (DBusConnection *conn,
_dbus_connection_test_get_locks (DBusConnection *connection,
DBusMutex **mutex_loc,
DBusMutex **dispatch_mutex_loc,
DBusMutex **io_path_mutex_loc,
DBusCondVar **dispatch_cond_loc,
DBusCondVar **io_path_cond_loc)
{
*mutex_loc = conn->mutex;
*dispatch_mutex_loc = conn->dispatch_mutex;
*io_path_mutex_loc = conn->io_path_mutex;
*dispatch_cond_loc = conn->dispatch_cond;
*io_path_cond_loc = conn->io_path_cond;
*mutex_loc = connection->mutex;
*dispatch_mutex_loc = connection->dispatch_mutex;
*io_path_mutex_loc = connection->io_path_mutex;
*dispatch_cond_loc = connection->dispatch_cond;
*io_path_cond_loc = connection->io_path_cond;
}
#endif
......@@ -578,10 +578,13 @@ _dbus_connection_message_sent (DBusConnection *connection,
dbus_message_unref (message);
}
/** Function to be called in protected_change_watch() with refcount held */
typedef dbus_bool_t (* DBusWatchAddFunction) (DBusWatchList *list,
DBusWatch *watch);
/** Function to be called in protected_change_watch() with refcount held */
typedef void (* DBusWatchRemoveFunction) (DBusWatchList *list,
DBusWatch *watch);
/** Function to be called in protected_change_watch() with refcount held */
typedef void (* DBusWatchToggleFunction) (DBusWatchList *list,
DBusWatch *watch,
dbus_bool_t enabled);
......@@ -696,10 +699,13 @@ _dbus_connection_toggle_watch_unlocked (DBusConnection *connection,
enabled);
}
/** Function to be called in protected_change_timeout() with refcount held */
typedef dbus_bool_t (* DBusTimeoutAddFunction) (DBusTimeoutList *list,
DBusTimeout *timeout);
/** Function to be called in protected_change_timeout() with refcount held */
typedef void (* DBusTimeoutRemoveFunction) (DBusTimeoutList *list,
DBusTimeout *timeout);
/** Function to be called in protected_change_timeout() with refcount held */
typedef void (* DBusTimeoutToggleFunction) (DBusTimeoutList *list,
DBusTimeout *timeout,
dbus_bool_t enabled);
......@@ -1736,6 +1742,58 @@ _dbus_connection_open_internal (const char *address,
return connection;
}
/**
* Closes a shared OR private connection, while dbus_connection_close() can
* only be used on private connections. Should only be called by the
* dbus code that owns the connection - an owner must be known,
* the open/close state is like malloc/free, not like ref/unref.
*
* @param connection the connection
*/
void
_dbus_connection_close_possibly_shared (DBusConnection *connection)
{
_dbus_assert (connection != NULL);
_dbus_assert (connection->generation == _dbus_current_generation);
CONNECTION_LOCK (connection);
_dbus_connection_close_possibly_shared_and_unlock (connection);
}
/**
* Like dbus_connection_send(), but assumes the connection
* is already locked on function entry, and unlocks before returning.
*
* @param connection the connection
* @param message the message to send
* @param client_serial return location for client serial of sent message
* @returns #FALSE on out-of-memory
*/
dbus_bool_t
_dbus_connection_send_and_unlock (DBusConnection *connection,
DBusMessage *message,
dbus_uint32_t *client_serial)
{
DBusPreallocatedSend *preallocated;
_dbus_assert (connection != NULL);
_dbus_assert (message != NULL);
preallocated = _dbus_connection_preallocate_send_unlocked (connection);
if (preallocated == NULL)
{
CONNECTION_UNLOCK (connection);
return FALSE;
}
_dbus_connection_send_preallocated_and_unlock (connection,
preallocated,
message,
client_serial);
return TRUE;
}
/** @} */
/**
......@@ -2062,16 +2120,6 @@ _dbus_connection_close_possibly_shared_and_unlock (DBusConnection *connection)
dbus_connection_unref (connection);
}
void
_dbus_connection_close_possibly_shared (DBusConnection *connection)
{
_dbus_assert (connection != NULL);
_dbus_assert (connection->generation == _dbus_current_generation);
CONNECTION_LOCK (connection);
_dbus_connection_close_possibly_shared_and_unlock (connection);
}
/**
* Closes a private connection, so no further data can be sent or received.
* This disconnects the transport (such as a socket) underlying the
......@@ -2505,30 +2553,6 @@ _dbus_connection_send_unlocked_no_update (DBusConnection *connection,
return TRUE;
}
dbus_bool_t
_dbus_connection_send_and_unlock (DBusConnection *connection,
DBusMessage *message,
dbus_uint32_t *client_serial)
{
DBusPreallocatedSend *preallocated;
_dbus_assert (connection != NULL);
_dbus_assert (message != NULL);
preallocated = _dbus_connection_preallocate_send_unlocked (connection);
if (preallocated == NULL)
{
CONNECTION_UNLOCK (connection);
return FALSE;
}
_dbus_connection_send_preallocated_and_unlock (connection,
preallocated,
message,
client_serial);
return TRUE;
}
/**
* Adds a message to the outgoing message queue. Does not block to
* write the message to the network; that happens asynchronously. To
......@@ -3997,7 +4021,7 @@ _dbus_connection_run_builtin_filters_unlocked_no_update (DBusConnection *connect
* unrefs the message. Returns a status indicating whether messages/data
* remain, more memory is needed, or all data has been processed.
*
* Even if the dispatch status is #DBUS_DISPATCH_DATA_REMAINS,
* Even if the dispatch status is #DBUS_DISPATCH_DATA_REMAINS
* does not necessarily dispatch a message, as the data may
* be part of authentication or the like.
*
......
......@@ -151,7 +151,7 @@ _dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator,
/**
* Deallocates an ID previously allocated with
* _dbus_data_slot_allocator_alloc(). Existing data stored on
* existing #DBusDataList objects with this ID will be freed when the
* existing #DBusDataSlotList objects with this ID will be freed when the
* data list is finalized, but may not be retrieved (and may only be
* replaced if someone else reallocates the slot).
* The slot value is reset to -1 if this is the last unref.
......
......@@ -58,6 +58,7 @@ typedef enum
DBUS_HASH_POINTER, /**< Hash keys are pointers. */
DBUS_HASH_ULONG /**< Hash keys are unsigned long. */
} DBusHashType;
DBusHashTable* _dbus_hash_table_new (DBusHashType type,
DBusFreeFunction key_free_function,
DBusFreeFunction value_free_function);
......
......@@ -28,8 +28,12 @@
#include <string.h>
#include <stdlib.h>
/* the blurb for this is "D-Bus secret" so it comes after "D-Bus low-level"
* which is the blurb for the DBus group, which makes Doxygen show
* the public API first on the index page. Yay for lame hacks.
*/
/**
* @defgroup DBusInternals D-Bus internal implementation details
* @defgroup DBusInternals D-Bus secret internal implementation details
* @brief Documentation useful when developing or debugging D-Bus itself.
*
*/
......@@ -288,6 +292,7 @@ _dbus_warn_check_failed(const char *format,
static dbus_bool_t verbose_initted = FALSE;
static dbus_bool_t verbose = TRUE;
/** Whether to show the current thread in verbose messages */
#define PTHREAD_IN_VERBOSE 0
#if PTHREAD_IN_VERBOSE
#include <pthread.h>
......@@ -304,6 +309,11 @@ _dbus_verbose_init (void)
}
}
/**
* Implementation of dbus_is_verbose() macro if built with verbose logging
* enabled.
* @returns whether verbose logging is active.
*/
dbus_bool_t
_dbus_is_verbose_real (void)
{
......
......@@ -322,8 +322,8 @@ void _dbus_set_bad_address (DBusError *error,
*/
union DBusGUID
{
dbus_uint32_t as_uint32s[DBUS_UUID_LENGTH_BYTES / 4];
char as_bytes[DBUS_UUID_LENGTH_BYTES];
dbus_uint32_t as_uint32s[DBUS_UUID_LENGTH_BYTES / 4]; /**< guid as four uint32 values */
char as_bytes[DBUS_UUID_LENGTH_BYTES]; /**< guid as 16 single-byte values */
};
void _dbus_generate_uuid (DBusGUID *uuid);
......
......@@ -905,4 +905,4 @@ _dbus_wait_for_memory (void)
_dbus_sleep_milliseconds (_dbus_get_oom_wait ());
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
......@@ -70,7 +70,7 @@ dbus_bool_t _dbus_loop_dispatch (DBusLoop *loop);
int _dbus_get_oom_wait (void);
void _dbus_wait_for_memory (void);
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
#endif /* DBUS_MAINLOOP_H */
......@@ -67,8 +67,8 @@ _DBUS_STRING_DEFINE_STATIC(_dbus_local_path_str, DBUS_PATH_LOCAL);
typedef struct
{
unsigned char code;
unsigned char type;
unsigned char code; /**< the field code */
unsigned char type; /**< the value type */
} HeaderFieldType;
static const HeaderFieldType
......
......@@ -124,6 +124,9 @@ _dbus_type_reader_equal_values (const DBusTypeReader *lhs,
}
/* TESTS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include "dbus-test.h"
#include "dbus-list.h"
#include <stdio.h>
......@@ -3557,4 +3560,6 @@ container_destroy (TestTypeNode *node)
}
}
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
#endif /* DBUS_BUILD_TESTS */
......@@ -1116,8 +1116,8 @@ _dbus_type_reader_get_signature (const DBusTypeReader *reader,
typedef struct
{
DBusString replacement;
int padding;
DBusString replacement; /**< Marshaled value including alignment padding */
int padding; /**< How much of the replacement block is padding */
} ReplacementBlock;
static dbus_bool_t
......
......@@ -23,6 +23,9 @@
#include <config.h>
#ifdef DBUS_BUILD_TESTS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include "dbus-internals.h"
#include "dbus-marshal-validate.h"
#include "dbus-marshal-recursive.h"
......@@ -579,4 +582,6 @@ _dbus_marshal_validate_test (void)
return TRUE;
}
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
#endif /* DBUS_BUILD_TESTS */
......@@ -157,7 +157,7 @@ main(int argc, char **argv)
#define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca)
#define T63 0x2ad7d2bb
#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e)
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
static void
md5_process(DBusMD5Context *context, const unsigned char *data /*[64]*/)
......
......@@ -22,6 +22,8 @@
*/
#include <config.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#ifdef DBUS_BUILD_TESTS
#include "dbus-message-factory.h"
#include "dbus-message-private.h"
......@@ -1221,4 +1223,6 @@ _dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter,
return TRUE;
}
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
#endif /* DBUS_BUILD_TESTS */
......@@ -126,6 +126,12 @@ _dbus_message_byteswap (DBusMessage *message)
_dbus_header_byteswap (&message->header, DBUS_COMPILER_BYTE_ORDER);
}
/** byte-swap the message if it doesn't match our byte order.
* Called only when we need the message in our own byte order,
* normally when reading arrays of integers or doubles.
* Otherwise should not be called since it would do needless
* work.
*/
#define ensure_byte_order(message) \
if (message->byte_order != DBUS_COMPILER_BYTE_ORDER) \
_dbus_message_byteswap (message)
......@@ -1119,10 +1125,9 @@ dbus_message_unref (DBusMessage *message)
* #DBUS_MESSAGE_TYPE_METHOD_CALL, #DBUS_MESSAGE_TYPE_METHOD_RETURN,
* #DBUS_MESSAGE_TYPE_ERROR, #DBUS_MESSAGE_TYPE_SIGNAL, but other
* types are allowed and all code must silently ignore messages of
* unknown type. DBUS_MESSAGE_TYPE_INVALID will never be returned,
* unknown type. #DBUS_MESSAGE_TYPE_INVALID will never be returned,
* however.
*
*
* @param message the message
* @returns the type of the message
*/
......
......@@ -1141,6 +1141,9 @@ _dbus_decompose_path (const char* data,
/** @} */
#ifdef DBUS_BUILD_TESTS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include "dbus-test.h"
#include <stdio.h>
......@@ -1926,4 +1929,6 @@ _dbus_object_tree_test (void)
return TRUE;
}
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
#endif /* DBUS_BUILD_TESTS */
......@@ -44,7 +44,14 @@
*
* Opaque object representing a reply message that we're waiting for.
*/
/**
* shorter and more visible way to write _dbus_connection_lock()
*/
#define CONNECTION_LOCK(connection) _dbus_connection_lock(connection)
/**
* shorter and more visible way to write _dbus_connection_unlock()
*/
#define CONNECTION_UNLOCK(connection) _dbus_connection_unlock(connection)
struct DBusPendingCall
......@@ -189,6 +196,13 @@ _dbus_pending_call_complete (DBusPendingCall *pending)
}
}
/**
* If the pending call hasn't been timed out, add its timeout
* error reply to the connection's incoming message queue.
*
* @param pending the pending call
* @param connection the connection the call was sent to
*/
void
_dbus_pending_call_queue_timeout_error_unlocked (DBusPendingCall *pending,
DBusConnection *connection)
......
This diff is collapsed.
......@@ -329,7 +329,7 @@ _dbus_transport_debug_pipe_new (const char *server_name,
* Sets error if the result is not OK.
*
* @param entry an address entry
* @param a new DBusServer, or #NULL on failure.
* @param server_p location to store a new DBusServer, or #NULL on failure.
* @param error location to store rationale for failure on bad address
* @returns the outcome
*
......@@ -376,6 +376,14 @@ _dbus_server_listen_debug_pipe (DBusAddressEntry *entry,
}
}
/**
* Opens a debug pipe transport, used in the test suite.
*
* @param entry the address entry to try opening as debug-pipe
* @param transport_p return location for the opened transport
* @param error error to be set
* @returns result of the attempt
*/
DBusTransportOpenResult
_dbus_transport_open_debug_pipe (DBusAddressEntry *entry,
DBusTransport **transport_p,
......
......@@ -43,7 +43,7 @@
* Sets error if the result is not OK.
*
* @param entry an address entry
* @param a new DBusServer, or #NULL on failure.
* @param server_p location to store a new DBusServer, or #NULL on failure.
* @param error location to store rationale for failure on bad address
* @returns the outcome
*
......
......@@ -194,10 +194,13 @@ _dbus_server_finalize_base (DBusServer *server)
}
/** Function to be called in protected_change_watch() with refcount held */
typedef dbus_bool_t (* DBusWatchAddFunction) (DBusWatchList *list,
DBusWatch *watch);
/** Function to be called in protected_change_watch() with refcount held */
typedef void (* DBusWatchRemoveFunction) (DBusWatchList *list,
DBusWatch *watch);
/** Function to be called in protected_change_watch() with refcount held */
typedef void (* DBusWatchToggleFunction) (DBusWatchList *list,
DBusWatch *watch,
dbus_bool_t enabled);
......@@ -307,11 +310,13 @@ _dbus_server_toggle_watch (DBusServer *server,
enabled);
}
/** Function to be called in protected_change_timeout() with refcount held */
typedef dbus_bool_t (* DBusTimeoutAddFunction) (DBusTimeoutList *list,
DBusTimeout *timeout);
/** Function to be called in protected_change_timeout() with refcount held */
typedef void (* DBusTimeoutRemoveFunction) (DBusTimeoutList *list,
DBusTimeout *timeout);
/** Function to be called in protected_change_timeout() with refcount held */
typedef void (* DBusTimeoutToggleFunction) (DBusTimeoutList *list,
DBusTimeout *timeout,
dbus_bool_t enabled);
......
......@@ -157,7 +157,7 @@ effort (for example the reengineering of a great many Capstone chips).
#define subRound(a, b, c, d, e, f, k, data) \
( e += ROTL( 5, a ) + f( b, c, d ) + k + data, b = ROTL( 30, b ) )
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
/* Perform the SHA transformation. Note that this code, like MD5, seems to
break some optimizing compilers due to the complexity of the expressions
......
......@@ -30,6 +30,9 @@
#ifdef __cplusplus
extern "C" {
#if 0
} /* avoids confusing emacs indentation */
#endif
#endif
/* Normally docs are in .c files, but there isn't a .c file for this. */
......@@ -44,6 +47,9 @@ extern "C" {
*/
/**
* Well-known bus types. See dbus_bus_get().
*/
typedef enum
{
DBUS_BUS_SESSION, /**< The login session bus */
......@@ -51,26 +57,37 @@ typedef enum
DBUS_BUS_STARTER /**< The bus that started us, if any */
} DBusBusType;
/**
* Results that a message handler can return.
*/
typedef enum
{
DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect */
DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect */
DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory to return another result */
DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */
DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */
DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */
} DBusHandlerResult;
/* Services */
/* Bus names */
/** The bus name used to talk to the bus itself. */
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
/* Paths */
/** The object path used to talk to the bus itself. */
#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
/** The object path used in local/in-process-generated messages. */
#define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local"
/* Interfaces, these #define don't do much other than
* catch typos at compile time
*/
/** The interface exported by the object with #DBUS_SERVICE_DBUS and #DBUS_PATH_DBUS */
#define DBUS_INTERFACE_DBUS "org.freedesktop.DBus"
/** The interface supported by introspectable objects */
#define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
/** The interface supported by objects with properties */
#define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
/** The interface supported by most dbus peers */
#define DBUS_INTERFACE_PEER "org.freedesktop.DBus.Peer"
/** This is a special interface whose methods can only be invoked
......@@ -102,6 +119,9 @@ typedef enum
/** @} */
#ifdef __cplusplus
#if 0
{ /* avoids confusing emacs indentation */
#endif
}
#endif
......
......@@ -29,9 +29,9 @@
typedef struct
{
const char *pos;
unsigned int finished : 1;
unsigned int in_array : 1;
const char *pos; /**< current position in the signature string */
unsigned int finished : 1; /**< true if we are at the end iter */
unsigned int in_array : 1; /**< true if we are a subiterator pointing to an array's element type */
} DBusSignatureRealIter;
/**
......
......@@ -2011,7 +2011,7 @@ _dbus_string_skip_white_reverse (const DBusString *str,
* @todo owen correctly notes that this is a stupid function (it was
* written purely for test code,
* e.g. dbus-message-builder.c). Probably should be enforced as test
* code only with #ifdef DBUS_BUILD_TESTS
* code only with ifdef DBUS_BUILD_TESTS
*
* @param source the source string
* @param dest the destination string (contents are replaced)
......
......@@ -107,6 +107,13 @@ _dbus_open_tcp_socket (int *fd,
return _dbus_open_socket(fd, AF_INET, SOCK_STREAM, 0, error);
}
/**
* Opens a UNIX domain socket (as in the socket() call).
* Does not bind the socket.
* @param fd return location for socket descriptor
* @param error return location for an error
* @returns #FALSE if error is set
*/
dbus_bool_t
_dbus_open_unix_socket (int *fd,
DBusError *error)
......@@ -114,6 +121,14 @@ _dbus_open_unix_socket (int *fd,
return _dbus_open_socket(fd, PF_UNIX, SOCK_STREAM, 0, error);
}
/**
* Closes a socket. Should not be used on non-socket
* file descriptors or handles.
*
* @param fd the socket
* @param error return location for an error
* @returns #FALSE if error is set
*/
dbus_bool_t
_dbus_close_socket (int fd,
DBusError *error)
......@@ -121,6 +136,15 @@ _dbus_close_socket (int fd,
return _dbus_close (fd, error);
}
/**
* Like _dbus_read(), but only works on sockets so is
* available on Windows.
*
* @param fd the socket
* @param buffer string to append data to
* @param count max amount of data to read
* @returns number of bytes appended to the string
*/
int
_dbus_read_socket (int fd,
DBusString *buffer,
......@@ -129,6 +153,16 @@ _dbus_read_socket (int fd,
return _dbus_read (fd, buffer, count);
}
/**
* Like _dbus_write(), but only supports sockets
* and is thus available on Windows.
*
* @param fd the file descriptor to write
* @param buffer the buffer to write data from
* @param start the first byte in the buffer to write
* @param len the number of bytes to try to write
* @returns the number of bytes written or -1 on error
*/
int
_dbus_write_socket (int fd,
const DBusString *buffer,
......@@ -138,6 +172,19 @@ _dbus_write_socket (int fd,
return _dbus_write (fd, buffer, start, len);
}
/**
* Like _dbus_write_two() but only works on sockets and is thus
* available on Windows.
*
* @param fd the file descriptor
* @param buffer1 first buffer
* @param start1 first byte to write in first buffer
* @param len1 number of bytes to write from first buffer
* @param buffer2 second buffer, or #NULL
* @param start2 first byte to write in second buffer
* @param len2 number of bytes to write in second buffer
* @returns total bytes written from both buffers, or -1 on error
*/
int
_dbus_write_socket_two (int fd,
const DBusString *buffer1,
......@@ -157,9 +204,12 @@ _dbus_write_socket_two (int fd,
* the data it reads to the DBusString buffer. It appends
* up to the given count, and returns the same value
* and same errno as read(). The only exception is that
* _dbus_read() handles EINTR for you. _dbus_read() can
* _dbus_read() handles EINTR for you. Also, _dbus_read() can
* return ENOMEM, even though regular UNIX read doesn't.
*
* Unlike _dbus_read_socket(), _dbus_read() is not available
* on Windows.
*
* @param fd the file descriptor to read from
* @param buffer the buffer to append data to
* @param count the amount of data to read
......@@ -2441,7 +2491,7 @@ _dbus_get_autolaunch_address (DBusString *address,
* we might want to use the registry instead of a file for
* this, and I'm not sure how we'd ensure the uuid gets created.
*
* @param guid to init with the machine's uuid
* @param machine_id guid to init with the machine's uuid
* @param create_if_not_found try to create the uuid if it doesn't exist
* @param error the error return
* @returns #FALSE if the error is set
......
......@@ -1258,6 +1258,14 @@ error:
return NULL;
}
/**
* Opens a TCP socket transport.
*
* @param entry the address entry to try opening as a tcp transport.
* @param transport_p return location for the opened transport
* @param error error to be set
* @returns result of the attempt
*/
DBusTransportOpenResult
_dbus_transport_open_socket(DBusAddressEntry *entry,
DBusTransport **transport_p,
......
......@@ -108,6 +108,14 @@ _dbus_transport_new_for_domain_socket (const char *path,
return NULL;
}
/**
* Opens platform specific transport types.
*
* @param entry the address entry to try opening
* @param transport_p return location for the opened transport
* @param error error to be set
* @returns result of the attempt
*/
DBusTransportOpenResult
_dbus_transport_open_platform_specific (DBusAddressEntry *entry,
DBusTransport **transport_p,
......