[gcab/wip/hughsie/gcab_file_set_bytes] gcab-file: Add gcab_file_set_bytes()




commit 686eb4b94021e3f7202347bfe5905bb9a707ebed
Author: Richard Hughes <richard hughsie com>
Date:   Tue May 11 20:53:17 2021 +0100

    gcab-file: Add gcab_file_set_bytes()
    
    This is required by fwupd.

 libgcab/gcab-file.c | 13 ++++++++++++-
 libgcab/gcab-file.h |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/libgcab/gcab-file.c b/libgcab/gcab-file.c
index b7e1c5c..3eb8460 100644
--- a/libgcab/gcab-file.c
+++ b/libgcab/gcab-file.c
@@ -100,7 +100,18 @@ gcab_file_set_name (GCabFile *self, const gchar *name)
     self->cfile->name = fname;
 }
 
-G_GNUC_INTERNAL void
+/**
+ * gcab_file_set_bytes:
+ * @self: a #GCabFile
+ * @bytes: a #GBytes
+ *
+ * Replace the #GBytes associated with @self.
+ * This is most usefule when the #GCabFile has been created using
+ * gcab_file_new_with_bytes() and the data needs to be modified.
+ *
+ * Since: 1.5
+ **/
+void
 gcab_file_set_bytes (GCabFile *self, GBytes *bytes)
 {
     if (self->bytes != NULL)
diff --git a/libgcab/gcab-file.h b/libgcab/gcab-file.h
index e051a9f..02e02e6 100644
--- a/libgcab/gcab-file.h
+++ b/libgcab/gcab-file.h
@@ -69,6 +69,7 @@ GCabFile *      gcab_file_new_with_file             (const gchar *name, GFile *f
 GCabFile *      gcab_file_new_with_bytes            (const gchar *name, GBytes *bytes);
 GFile *         gcab_file_get_file                  (GCabFile *file);
 GBytes *        gcab_file_get_bytes                 (GCabFile *file);
+void            gcab_file_set_bytes                 (GCabFile *file, GBytes *bytes);
 const gchar *   gcab_file_get_name                  (GCabFile *file);
 guint32         gcab_file_get_size                  (GCabFile *file);
 guint32         gcab_file_get_attributes            (GCabFile *file);


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