[sysprof] libsysprof-capture: add byte-order helper



commit ffda366809895477c46fb76a7ea541e5c89eea11
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 28 15:45:38 2019 -0700

    libsysprof-capture: add byte-order helper
    
    This isn't needed for reading captures, but can be helpful when dealing
    with embedded data such as file frames.

 src/libsysprof-capture/sysprof-capture-reader.c | 8 ++++++++
 src/libsysprof-capture/sysprof-capture-reader.h | 2 ++
 2 files changed, 10 insertions(+)
---
diff --git a/src/libsysprof-capture/sysprof-capture-reader.c b/src/libsysprof-capture/sysprof-capture-reader.c
index 2e91ac6..567db71 100644
--- a/src/libsysprof-capture/sysprof-capture-reader.c
+++ b/src/libsysprof-capture/sysprof-capture-reader.c
@@ -1277,3 +1277,11 @@ sysprof_capture_reader_read_file_fd (SysprofCaptureReader *self,
 
   g_return_val_if_reached (FALSE);
 }
+
+gint
+sysprof_capture_reader_get_byte_order (SysprofCaptureReader *self)
+{
+  g_return_val_if_fail (self != NULL, 0);
+
+  return self->endian;
+}
diff --git a/src/libsysprof-capture/sysprof-capture-reader.h b/src/libsysprof-capture/sysprof-capture-reader.h
index 8ee2ea2..49b3071 100644
--- a/src/libsysprof-capture/sysprof-capture-reader.h
+++ b/src/libsysprof-capture/sysprof-capture-reader.h
@@ -40,6 +40,8 @@ SysprofCaptureReader                   *sysprof_capture_reader_ref
 SYSPROF_AVAILABLE_IN_ALL
 void                                    sysprof_capture_reader_unref               (SysprofCaptureReader     
*self);
 SYSPROF_AVAILABLE_IN_ALL
+gint                                    sysprof_capture_reader_get_byte_order      (SysprofCaptureReader     
*self);
+SYSPROF_AVAILABLE_IN_ALL
 const gchar                            *sysprof_capture_reader_get_filename        (SysprofCaptureReader     
*self);
 SYSPROF_AVAILABLE_IN_ALL
 const gchar                            *sysprof_capture_reader_get_time            (SysprofCaptureReader     
*self);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]