[gcab] Add gcab_file_set_attributes()



commit 4aeab3f86159cec8050e165af8c4f64e13c34526
Author: Richard Hughes <richard hughsie com>
Date:   Fri Dec 15 10:12:53 2017 +0000

    Add gcab_file_set_attributes()
    
    This allows the user of the library to set overwrite file attributes, for
    instance setting GCAB_FILE_ATTRIBUTE_SYSTEM.

 libgcab/gcab-file.c  |   16 ++++++++++++++++
 libgcab/gcab-file.h  |    1 +
 libgcab/libgcab.syms |    1 +
 3 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/libgcab/gcab-file.c b/libgcab/gcab-file.c
index e2e24e9..118f1ba 100644
--- a/libgcab/gcab-file.c
+++ b/libgcab/gcab-file.c
@@ -305,6 +305,22 @@ gcab_file_get_attributes (GCabFile *self)
 }
 
 /**
+ * gcab_file_set_attributes:
+ * @file: a #GCabFile
+ * @attr: the attributes, e.g. %GCAB_FILE_ATTRIBUTE_RDONLY
+ *
+ * Set the file attributes.
+ *
+ * Since: 1.0
+ **/
+void
+gcab_file_set_attributes (GCabFile *self, guint32 attr)
+{
+    g_return_if_fail (GCAB_IS_FILE (self));
+    self->cfile->fattr = attr;
+}
+
+/**
  * gcab_file_get_name:
  * @file: a #GCabFile
  *
diff --git a/libgcab/gcab-file.h b/libgcab/gcab-file.h
index 9a3a134..ab3f012 100644
--- a/libgcab/gcab-file.h
+++ b/libgcab/gcab-file.h
@@ -74,6 +74,7 @@ gboolean        gcab_file_get_date                  (GCabFile *file, GTimeVal *r
 const gchar *   gcab_file_get_extract_name          (GCabFile *file);
 void            gcab_file_set_extract_name          (GCabFile *file, const gchar *name);
 void            gcab_file_set_date                  (GCabFile *file, const GTimeVal *tv);
+void            gcab_file_set_attributes            (GCabFile *file, guint32 attr);
 
 G_END_DECLS
 
diff --git a/libgcab/libgcab.syms b/libgcab/libgcab.syms
index d14729b..80f59c5 100644
--- a/libgcab/libgcab.syms
+++ b/libgcab/libgcab.syms
@@ -43,6 +43,7 @@ LIBGCAB1_0.6 {
 } LIBGCAB1_0.5;
 
 LIBGCAB1_1.0 {
+        gcab_file_set_attributes;
         gcab_file_set_date;
         gcab_folder_get_comptype;
         gcab_folder_get_file_by_name;


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