]> sigrok.org Git - libsigrok.git/blobdiff - src/libsigrok-internal.h
session: Make event source injection API private
[libsigrok.git] / src / libsigrok-internal.h
index c3868b4473e099e307c3583adf42fd2b53481a89..95ac98f1d049d34078761fe63291ca6373ca11d8 100644 (file)
@@ -706,15 +706,10 @@ struct sr_session {
        /** 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;
@@ -722,6 +717,8 @@ struct sr_session {
        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,
@@ -733,6 +730,21 @@ SR_PRIV int sr_session_source_destroyed(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);