libsysprof-capture: Move MappedRingBufferSource to libsysprof

As preparation for dropping the GLib dependency from libsysprof-capture,
move the `GSource` which links a `MappedRingBuffer` to a `GMainContext`
from libsysprof-capture to libsysprof.

This requires adding one new piece of API to libsysprof-capture to check
whether the `MappedRingBuffer` is empty.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
This commit is contained in:
Philip Withnall
2020-06-30 16:43:48 +01:00
parent d2047fb557
commit b449baa205
6 changed files with 189 additions and 106 deletions

View File

@ -78,15 +78,6 @@ gboolean mapped_ring_buffer_drain (MappedRingBuffer
MappedRingBufferCallback callback,
gpointer user_data);
G_GNUC_INTERNAL
guint mapped_ring_buffer_create_source (MappedRingBuffer *self,
MappedRingBufferCallback callback,
gpointer user_data);
G_GNUC_INTERNAL
guint mapped_ring_buffer_create_source_full (MappedRingBuffer *self,
MappedRingBufferCallback callback,
gpointer user_data,
GDestroyNotify destroy);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MappedRingBuffer, mapped_ring_buffer_unref)
gboolean mapped_ring_buffer_is_empty (MappedRingBuffer *self);
G_END_DECLS