/** User data to be passed to the session stop callback. */
void *stopped_cb_data;
- /** Mutex protecting the main context pointer and ownership flag. */
+ /** Mutex protecting the main context pointer. */
GMutex main_mutex;
/** Context of the session main loop. */
GMainContext *main_context;
- /** Whether we are using the thread's default context. */
- gboolean main_context_is_default;
-
- /** Whether the session has been started. */
- gboolean running;
/** Registered event sources for this session. */
GHashTable *event_sources;
GMainLoop *main_loop;
/** ID of idle source for dispatching the session stop notification. */
unsigned int stop_check_id;
+ /** Whether the session has been started. */
+ gboolean running;
};
SR_PRIV int sr_session_source_add_internal(struct sr_session *session,
SR_PRIV int sr_session_fd_source_add(struct sr_session *session,
void *key, gintptr fd, int events, int timeout,
sr_receive_data_callback cb, void *cb_data);
+
+SR_PRIV int sr_session_source_add(struct sr_session *session, int fd,
+ int events, int timeout, sr_receive_data_callback cb, void *cb_data);
+SR_PRIV int sr_session_source_add_pollfd(struct sr_session *session,
+ GPollFD *pollfd, int timeout, sr_receive_data_callback cb,
+ void *cb_data);
+SR_PRIV int sr_session_source_add_channel(struct sr_session *session,
+ GIOChannel *channel, int events, int timeout,
+ sr_receive_data_callback cb, void *cb_data);
+SR_PRIV int sr_session_source_remove(struct sr_session *session, int fd);
+SR_PRIV int sr_session_source_remove_pollfd(struct sr_session *session,
+ GPollFD *pollfd);
+SR_PRIV int sr_session_source_remove_channel(struct sr_session *session,
+ GIOChannel *channel);
+
SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi,
const struct sr_datafeed_packet *packet);
SR_PRIV int sr_sessionfile_check(const char *filename);