}
static int _sr_session_source_add(GPollFD *pollfd, int timeout,
- sr_receive_data_callback_t cb, void *cb_data, gintptr poll_object)
+ sr_receive_data_callback_t cb, void *cb_data, gintptr poll_object)
{
struct source *new_sources, *s;
GPollFD *new_pollfds;
new_pollfds = g_try_realloc(pollfds, sizeof(GPollFD) * (num_sources + 1));
if (!new_pollfds) {
- sr_err("session: %s: new_sources malloc failed", __func__);
+ sr_err("session: %s: new_pollfds malloc failed", __func__);
return SR_ERR_MALLOC;
}
}
/**
- * Add a event source for a GPollFD
+ * Add an event source for a GPollFD.
*
* TODO: More error checks etc.
*
SR_API int sr_session_source_add_pollfd(GPollFD *pollfd, int timeout,
sr_receive_data_callback_t cb, void *cb_data)
{
- return _sr_session_source_add(pollfd, timeout, cb, cb_data, (gintptr)pollfd);
+ return _sr_session_source_add(pollfd, timeout, cb,
+ cb_data, (gintptr)pollfd);
}
/**
- * Add a event source for a GIOChannel
+ * Add an event source for a GIOChannel.
*
* TODO: More error checks etc.
*
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or
* SR_ERR_MALLOC upon memory allocation errors.
*/
-SR_API int sr_session_source_add_channel(GIOChannel *channel, int events, int timeout,
- sr_receive_data_callback_t cb, void *cb_data)
+SR_API int sr_session_source_add_channel(GIOChannel *channel, int events,
+ int timeout, sr_receive_data_callback_t cb, void *cb_data)
{
GPollFD p;
new_pollfds = g_try_realloc(sources, sizeof(GPollFD) * num_sources);
if (!new_pollfds && num_sources > 0) {
- sr_err("session: %s: new_sources malloc failed", __func__);
+ sr_err("session: %s: new_pollfds malloc failed", __func__);
return SR_ERR_MALLOC;
}
*
* TODO: More error checks.
*
- * @param fd: The file descriptor for which the source should be removed.
+ * @param fd The file descriptor for which the source should be removed.
*
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or
* SR_ERR_MALLOC upon memory allocation errors, SR_ERR_BUG upon
*
* TODO: More error checks.
*
- * @parama channel: The channel for which the source should be removed.
+ * @param channel The channel for which the source should be removed.
*
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or
* SR_ERR_MALLOC upon memory allocation errors, SR_ERR_BUG upon