Commit e749851b authored by Pekka Pessi's avatar Pekka Pessi
Browse files

su/su_root.c: fixed whitespace

darcs-hash:20081127130704-db55f-348b3cd8635ec2623a2be5985711cd997c324773.gz
parent 80d875dd
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
*/ */
/**@ingroup su_wait /**@ingroup su_wait
* @CFILE su_root.c * @CFILE su_root.c
* OS-independent synchronization interface. * OS-independent synchronization interface.
* @internal * @internal
* *
* @author Pekka Pessi <Pekka.Pessi@nokia.com> * @author Pekka Pessi <Pekka.Pessi@nokia.com>
* *
* @date Created: Tue Sep 14 15:51:04 1999 ppessi * @date Created: Tue Sep 14 15:51:04 1999 ppessi
*/ */
...@@ -56,7 +56,7 @@ struct su_root_s; ...@@ -56,7 +56,7 @@ struct su_root_s;
#include "sofia-sip/su_alloc.h" #include "sofia-sip/su_alloc.h"
/**@ingroup su_wait /**@ingroup su_wait
* *
* @page su_root_t Tasks and root objects * @page su_root_t Tasks and root objects
* *
* A task is the basic execution unit for the Sofia event-driven programming * A task is the basic execution unit for the Sofia event-driven programming
...@@ -91,8 +91,8 @@ struct su_root_s; ...@@ -91,8 +91,8 @@ struct su_root_s;
* New tasks can be created via su_clone_start() function. * New tasks can be created via su_clone_start() function.
*/ */
/**@ingroup su_wait /**@ingroup su_wait
* *
* @page su_root_register Registering Wait Objects * @page su_root_register Registering Wait Objects
* *
* When application expects I/O events, it can create a wait object and * When application expects I/O events, it can create a wait object and
...@@ -111,8 +111,8 @@ struct su_root_s; ...@@ -111,8 +111,8 @@ struct su_root_s;
*/ */
/**@ingroup su_wait /**@ingroup su_wait
* *
* Contains hint of number of sockets supported by su_root_t */ * Contains hint of number of sockets supported by su_root_t */
int su_root_size_hint = 64; int su_root_size_hint = 64;
/* ========================================================================= /* =========================================================================
...@@ -187,7 +187,7 @@ _su_task_r su_task_new(su_task_r task, su_root_t *root, su_port_t *port) ...@@ -187,7 +187,7 @@ _su_task_r su_task_new(su_task_r task, su_root_t *root, su_port_t *port)
void su_task_copy(su_task_r dst, su_task_r const src) void su_task_copy(su_task_r dst, su_task_r const src)
{ {
su_port_t *port; su_port_t *port;
assert(src); assert(dst); assert(src); assert(dst);
SU_TASK_ZAP(dst, su_task_copy); SU_TASK_ZAP(dst, su_task_copy);
...@@ -219,10 +219,10 @@ void su_task_move(su_task_r dst, su_task_r src) ...@@ -219,10 +219,10 @@ void su_task_move(su_task_r dst, su_task_r src)
/** /**
* Compare two tasks with each other. * Compare two tasks with each other.
* *
* @param a First task * @param a First task
* @param b Second task * @param b Second task
* *
* @retval negative number, if a < b * @retval negative number, if a < b
* @retval positive number, if a > b * @retval positive number, if a > b
* @retval 0, if a == b. * @retval 0, if a == b.
...@@ -249,14 +249,14 @@ int su_task_cmp(su_task_r const a, su_task_r const b) ...@@ -249,14 +249,14 @@ int su_task_cmp(su_task_r const a, su_task_r const b)
* *
* @param task task handle * @param task task handle
* *
* @retval true (nonzero) if task is not stopped, * @retval true (nonzero) if task is not stopped,
* @retval zero if it is null or stopped. * @retval zero if it is null or stopped.
*/ */
int su_task_is_running(su_task_r const task) int su_task_is_running(su_task_r const task)
{ {
return return
task && task &&
task->sut_port && task->sut_port &&
task->sut_root; task->sut_root;
} }
...@@ -265,7 +265,7 @@ int su_task_is_running(su_task_r const task) ...@@ -265,7 +265,7 @@ int su_task_is_running(su_task_r const task)
* *
* @param self task handle * @param self task handle
* @param root pointer to the root object * @param root pointer to the root object
* *
* @retval 0 if successful, * @retval 0 if successful,
* @retval -1 otherwise. * @retval -1 otherwise.
*/ */
...@@ -275,16 +275,16 @@ int su_task_attach(su_task_r self, su_root_t *root) ...@@ -275,16 +275,16 @@ int su_task_attach(su_task_r self, su_root_t *root)
self->sut_root = root; self->sut_root = root;
return 0; return 0;
} }
else else
return -1; return -1;
} }
/** /**
* Get root pointer attached to a task handle. * Get root pointer attached to a task handle.
* *
* @param self task handle * @param self task handle
* *
* @return * @return
* A pointer to root object attached to the task handle, or NULL if no root * A pointer to root object attached to the task handle, or NULL if no root
* object has been attached. * object has been attached.
*/ */
...@@ -307,7 +307,7 @@ int su_task_detach(su_task_r self) ...@@ -307,7 +307,7 @@ int su_task_detach(su_task_r self)
/** /**
* Return the timer list associated with given task. * Return the timer list associated with given task.
* *
* @param task task handle * @param task task handle
* *
* @return A timer list of the task. If there are no timers, it returns * @return A timer list of the task. If there are no timers, it returns
...@@ -408,7 +408,7 @@ su_root_t *su_root_create_with_port(su_root_magic_t *magic, ...@@ -408,7 +408,7 @@ su_root_t *su_root_create_with_port(su_root_magic_t *magic,
/* This one creates a new reference to port */ /* This one creates a new reference to port */
su_task_new(self->sur_task, self, port); su_task_new(self->sur_task, self, port);
/* ... so we zap the old one below */ /* ... so we zap the old one below */
} }
su_port_decref(port, "su_root_create_with_port"); su_port_decref(port, "su_root_create_with_port");
...@@ -416,7 +416,7 @@ su_root_t *su_root_create_with_port(su_root_magic_t *magic, ...@@ -416,7 +416,7 @@ su_root_t *su_root_create_with_port(su_root_magic_t *magic,
} }
/** Destroy a root object. /** Destroy a root object.
* *
* Stop and free an instance of su_root_t * Stop and free an instance of su_root_t
* *
* @param self pointer to a root object. * @param self pointer to a root object.
...@@ -541,7 +541,7 @@ struct _GSource *su_root_gsource(su_root_t *self) ...@@ -541,7 +541,7 @@ struct _GSource *su_root_gsource(su_root_t *self)
return su_port_gsource(self->sur_port); return su_port_gsource(self->sur_port);
} }
/** Register a su_wait_t object. /** Register a su_wait_t object.
* *
* The function su_root_register() registers a su_wait_t object. The wait * The function su_root_register() registers a su_wait_t object. The wait
* object, a callback function and a argument are stored to the root * object, a callback function and a argument are stored to the root
...@@ -655,7 +655,7 @@ int su_root_eventmask(su_root_t *self, int index, int socket, int events) ...@@ -655,7 +655,7 @@ int su_root_eventmask(su_root_t *self, int index, int socket, int events)
* *
* @param self pointer to root object * @param self pointer to root object
* @param multishot multishot mode (0 => disables, 1 => enables, -1 => query) * @param multishot multishot mode (0 => disables, 1 => enables, -1 => query)
* *
* @retval 0 multishot mode is disabled * @retval 0 multishot mode is disabled
* @retval 1 multishot mode is enabled * @retval 1 multishot mode is enabled
* @retval -1 an error occurred * @retval -1 an error occurred
...@@ -808,8 +808,8 @@ _su_task_r su_root_parent(su_root_t const *self) ...@@ -808,8 +808,8 @@ _su_task_r su_root_parent(su_root_t const *self)
} }
/** Add a pre-poll callback. */ /** Add a pre-poll callback. */
int su_root_add_prepoll(su_root_t *root, int su_root_add_prepoll(su_root_t *root,
su_prepoll_f *callback, su_prepoll_f *callback,
su_prepoll_magic_t *magic) su_prepoll_magic_t *magic)
{ {
if (root == NULL) if (root == NULL)
...@@ -840,7 +840,7 @@ int su_root_release(su_root_t *root) ...@@ -840,7 +840,7 @@ int su_root_release(su_root_t *root)
return su_port_release(root->sur_port); return su_port_release(root->sur_port);
} }
/** Obtain the root port from other thread. /** Obtain the root port from other thread.
* *
* @param root pointer to root object * @param root pointer to root object
* *
...@@ -848,7 +848,7 @@ int su_root_release(su_root_t *root) ...@@ -848,7 +848,7 @@ int su_root_release(su_root_t *root)
* @retval -1 upon an error * @retval -1 upon an error
* *
* @ERRORS * @ERRORS
* @ERROR EFAULT * @ERROR EFAULT
* @NEW_1_12_7 * @NEW_1_12_7
*/ */
int su_root_obtain(su_root_t *root) int su_root_obtain(su_root_t *root)
...@@ -858,7 +858,7 @@ int su_root_obtain(su_root_t *root) ...@@ -858,7 +858,7 @@ int su_root_obtain(su_root_t *root)
return su_port_obtain(root->sur_port); return su_port_obtain(root->sur_port);
} }
/**Check if a thread has obtained the root. /**Check if a thread has obtained the root.
* *
* @param root a pointer to root object * @param root a pointer to root object
* *
...@@ -883,13 +883,13 @@ int su_root_has_thread(su_root_t *root) ...@@ -883,13 +883,13 @@ int su_root_has_thread(su_root_t *root)
/** /**
* Allocate a su message of given size. * Allocate a su message of given size.
* *
* Allocate a su message with given data size. * Allocate a su message with given data size.
* *
* @param rmsg handle to the new message (may be uninitialized prior calling) * @param rmsg handle to the new message (may be uninitialized prior calling)
* @param size size of the message data * @param size size of the message data
* *
* @retval 0 if successful, * @retval 0 if successful,
* @retval -1 if message allocation fails. * @retval -1 if message allocation fails.
* *
* @NEW_1_12_8 * @NEW_1_12_8
*/ */
...@@ -919,7 +919,7 @@ int su_msg_new(su_msg_r rmsg, size_t size) ...@@ -919,7 +919,7 @@ int su_msg_new(su_msg_r rmsg, size_t size)
* @param size size of the message data * @param size size of the message data
* *
* @retval 0 if successful, * @retval 0 if successful,
* @retval -1 if message allocation fails. * @retval -1 if message allocation fails.
*/ */
int su_msg_create(su_msg_r rmsg, int su_msg_create(su_msg_r rmsg,
su_task_r const to, su_task_r const to,
...@@ -932,17 +932,17 @@ int su_msg_create(su_msg_r rmsg, ...@@ -932,17 +932,17 @@ int su_msg_create(su_msg_r rmsg,
SU_TASK_COPY(rmsg[0]->sum_from, from, su_msg_create); SU_TASK_COPY(rmsg[0]->sum_from, from, su_msg_create);
rmsg[0]->sum_func = wakeup; rmsg[0]->sum_func = wakeup;
return 0; return 0;
} }
return -1; return -1;
} }
/** Add a delivery report function to a message. /** Add a delivery report function to a message.
* *
* The delivery report funcgtion gets called by the sending task after the * The delivery report funcgtion gets called by the sending task after the
* message was delivered and the message function was executed. (The * message was delivered and the message function was executed. (The
* su_root_t message delivery loop calls su_msg_delivery_report() * su_root_t message delivery loop calls su_msg_delivery_report()
* *
*/ */
int su_msg_report(su_msg_r msg, int su_msg_report(su_msg_r msg,
su_msg_f report) su_msg_f report)
...@@ -1068,7 +1068,7 @@ void su_msg_destroy(su_msg_r rmsg) ...@@ -1068,7 +1068,7 @@ void su_msg_destroy(su_msg_r rmsg)
} }
} }
/** Gets a pointer to the message data area. /** Gets a pointer to the message data area.
* *
* The function @c su_msg_data() returns a pointer to the message data * The function @c su_msg_data() returns a pointer to the message data
* area. If @c rmsg contains a @c NULL handle, or message size is 0, @c NULL * area. If @c rmsg contains a @c NULL handle, or message size is 0, @c NULL
...@@ -1076,7 +1076,7 @@ void su_msg_destroy(su_msg_r rmsg) ...@@ -1076,7 +1076,7 @@ void su_msg_destroy(su_msg_r rmsg)
* *
* @param rmsg message handle * @param rmsg message handle
* *
* @return A pointer to the message data area is returned. * @return A pointer to the message data area is returned.
*/ */
su_msg_arg_t *su_msg_data(su_msg_cr rmsg) su_msg_arg_t *su_msg_data(su_msg_cr rmsg)
{ {
...@@ -1101,7 +1101,7 @@ isize_t su_msg_size(su_msg_cr rmsg) ...@@ -1101,7 +1101,7 @@ isize_t su_msg_size(su_msg_cr rmsg)
* *
* @param rmsg message handle * @param rmsg message handle
* *
* @return The task handle of the sender is returned. * @return The task handle of the sender is returned.
*/ */
_su_task_r su_msg_from(su_msg_cr rmsg) _su_task_r su_msg_from(su_msg_cr rmsg)
{ {
...@@ -1118,14 +1118,14 @@ _su_task_r su_msg_from(su_msg_cr rmsg) ...@@ -1118,14 +1118,14 @@ _su_task_r su_msg_from(su_msg_cr rmsg)
* *
* @param rmsg message handle * @param rmsg message handle
* *
* @return The task handle of the recipient is returned. * @return The task handle of the recipient is returned.
*/ */
_su_task_r su_msg_to(su_msg_cr rmsg) _su_task_r su_msg_to(su_msg_cr rmsg)
{ {
return rmsg[0] ? rmsg[0]->sum_to : NULL; return rmsg[0] ? rmsg[0]->sum_to : NULL;
} }
/** Remove references to 'from' and 'to' tasks from a message. /** Remove references to 'from' and 'to' tasks from a message.
* *
* @param rmsg message handle * @param rmsg message handle
*/ */
...@@ -1137,7 +1137,7 @@ void su_msg_remove_refs(su_msg_cr rmsg) ...@@ -1137,7 +1137,7 @@ void su_msg_remove_refs(su_msg_cr rmsg)
} }
} }
/**Send a message. /**Send a message.
* *
* The function @c su_msg_send() sends the message. The message is added to * The function @c su_msg_send() sends the message. The message is added to
* the recipients message queue, and recipient is waken up. The caller may * the recipients message queue, and recipient is waken up. The caller may
...@@ -1156,7 +1156,7 @@ int su_msg_send(su_msg_r rmsg) ...@@ -1156,7 +1156,7 @@ int su_msg_send(su_msg_r rmsg)
if (rmsg[0]) { if (rmsg[0]) {
su_msg_t *msg = rmsg[0]; su_msg_t *msg = rmsg[0];
if (msg->sum_to->sut_port) if (msg->sum_to->sut_port)
return su_port_send(msg->sum_to->sut_port, rmsg); return su_port_send(msg->sum_to->sut_port, rmsg);
su_msg_destroy(rmsg); su_msg_destroy(rmsg);
...@@ -1164,7 +1164,7 @@ int su_msg_send(su_msg_r rmsg) ...@@ -1164,7 +1164,7 @@ int su_msg_send(su_msg_r rmsg)
return -1; return -1;
} }
return 0; return 0;
} }
/** Send message to the @a to_task and mark @a from_task as sender. /** Send message to the @a to_task and mark @a from_task as sender.
...@@ -1183,9 +1183,9 @@ SOFIAPUBFUN int su_msg_send_to(su_msg_r rmsg, ...@@ -1183,9 +1183,9 @@ SOFIAPUBFUN int su_msg_send_to(su_msg_r rmsg,
if (wakeup) if (wakeup)
msg->sum_func = wakeup; msg->sum_func = wakeup;
if (msg->sum_to->sut_port && if (msg->sum_to->sut_port &&
msg->sum_to->sut_port != to_task->sut_port) { msg->sum_to->sut_port != to_task->sut_port) {
SU_TASK_ZAP(msg->sum_to, "su_msg_send_to"); SU_TASK_ZAP(msg->sum_to, "su_msg_send_to");
} }
if (to_task->sut_port != NULL) { if (to_task->sut_port != NULL) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment