[gcab/wip/hughsie/gcab_file_set_bytes: 9/9] gcab-file: Add gcab_file_set_bytes()
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcab/wip/hughsie/gcab_file_set_bytes: 9/9] gcab-file: Add gcab_file_set_bytes()
- Date: Mon, 4 Oct 2021 08:58:08 +0000 (UTC)
commit 3ddb1f574d140ff228c121fe4244a3783fcf803a
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 +
libgcab/gcab-priv.h | 1 -
libgcab/libgcab.syms | 4 ++++
4 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/libgcab/gcab-file.c b/libgcab/gcab-file.c
index b7e1c5c..c2da3a0 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:
+ * @file: 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);
diff --git a/libgcab/gcab-priv.h b/libgcab/gcab-priv.h
index a3894e8..6d200e5 100644
--- a/libgcab/gcab-priv.h
+++ b/libgcab/gcab-priv.h
@@ -50,7 +50,6 @@ guint32 gcab_file_get_usize (GCabFile *file);
GFile *gcab_file_get_gfile (GCabFile *file);
cfile_t *gcab_file_get_cfile (GCabFile *file);
void gcab_file_add_attribute (GCabFile *file, guint32 attribute);
-void gcab_file_set_bytes (GCabFile *file, GBytes *bytes);
gsize gcab_folder_get_ndatablocks (GCabFolder *folder);
gboolean gcab_folder_extract (GCabFolder *self,
diff --git a/libgcab/libgcab.syms b/libgcab/libgcab.syms
index 9d96c74..7c27ffd 100644
--- a/libgcab/libgcab.syms
+++ b/libgcab/libgcab.syms
@@ -56,3 +56,7 @@ LIBGCAB1_1.4 {
gcab_file_get_date_time;
gcab_file_set_date_time;
} LIBGCAB1_1.0;
+
+LIBGCAB1_1.5 {
+ gcab_file_set_bytes;
+} LIBGCAB1_1.4;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]