[gcab] Add gcab_folder_get_comptype()



commit 3197797cf47c32bc048238ca20f78dadbe999a5f
Author: Richard Hughes <richard hughsie com>
Date:   Tue Dec 12 23:20:24 2017 +0000

    Add gcab_folder_get_comptype()
    
    This allows creation of a duplicate archive as we know what kind of folder
    compression to use.

 docs/reference/gcab-docs.sgml    |    1 +
 docs/reference/gcab-sections.txt |    1 +
 libgcab/gcab-folder.c            |   12 +++++++++++-
 libgcab/gcab-folder.h            |    1 +
 libgcab/gcab-priv.h              |    1 -
 libgcab/libgcab.syms             |    4 ++++
 6 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/docs/reference/gcab-docs.sgml b/docs/reference/gcab-docs.sgml
index 45490e5..ef07d5c 100644
--- a/docs/reference/gcab-docs.sgml
+++ b/docs/reference/gcab-docs.sgml
@@ -28,4 +28,5 @@
   <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
   <xi:include href="xml/api-index-0.5.xml"><xi:fallback /></xi:include>
   <xi:include href="xml/api-index-0.6.xml"><xi:fallback /></xi:include>
+  <xi:include href="xml/api-index-1.0.xml"><xi:fallback /></xi:include>
 </book>
diff --git a/docs/reference/gcab-sections.txt b/docs/reference/gcab-sections.txt
index 9d807ea..ebfc90e 100644
--- a/docs/reference/gcab-sections.txt
+++ b/docs/reference/gcab-sections.txt
@@ -60,6 +60,7 @@ gcab_folder_new
 gcab_folder_add_file
 gcab_folder_get_files
 gcab_folder_get_nfiles
+gcab_folder_get_comptype
 <SUBSECTION Standard>
 GCAB_FOLDER
 GCAB_FOLDER_CLASS
diff --git a/libgcab/gcab-folder.c b/libgcab/gcab-folder.c
index e9bb1a2..7785fda 100644
--- a/libgcab/gcab-folder.c
+++ b/libgcab/gcab-folder.c
@@ -175,7 +175,17 @@ gcab_folder_get_ndatablocks (GCabFolder *self)
     return total_size / DATABLOCKSIZE + 1 ;
 }
 
-G_GNUC_INTERNAL gint
+/**
+ * gcab_folder_get_comptype:
+ * @cabfolder: a #GCabFolder
+ *
+ * Returns the compression used in this folder.
+ *
+ * Returns: a #GCabCompression, e.g. %GCAB_COMPRESSION_MSZIP
+ *
+ * Since: 1.0
+ **/
+gint
 gcab_folder_get_comptype (GCabFolder *self)
 {
     return self->comptype;
diff --git a/libgcab/gcab-folder.h b/libgcab/gcab-folder.h
index 12a191b..e54a468 100644
--- a/libgcab/gcab-folder.h
+++ b/libgcab/gcab-folder.h
@@ -63,6 +63,7 @@ gboolean        gcab_folder_add_file          (GCabFolder *cabfolder,
                                                GError **error);
 guint           gcab_folder_get_nfiles        (GCabFolder *cabfolder);
 GSList *        gcab_folder_get_files         (GCabFolder *cabfolder);
+gint            gcab_folder_get_comptype      (GCabFolder *cabfolder);
 
 G_END_DECLS
 
diff --git a/libgcab/gcab-priv.h b/libgcab/gcab-priv.h
index b2cb232..6052a43 100644
--- a/libgcab/gcab-priv.h
+++ b/libgcab/gcab-priv.h
@@ -51,7 +51,6 @@ GFile           *gcab_file_get_gfile                 (GCabFile *file);
 cfile_t         *gcab_file_get_cfile                 (GCabFile *file);
 void             gcab_file_add_attribute             (GCabFile *file, guint32 attribute);
 
-gint             gcab_folder_get_comptype            (GCabFolder *folder);
 gsize            gcab_folder_get_ndatablocks         (GCabFolder *folder);
 gboolean         gcab_folder_extract                 (GCabFolder *self,
                                                       GFile *path,
diff --git a/libgcab/libgcab.syms b/libgcab/libgcab.syms
index d4b5c19..e65f06c 100644
--- a/libgcab/libgcab.syms
+++ b/libgcab/libgcab.syms
@@ -41,3 +41,7 @@ LIBGCAB1_0.6 {
         gcab_file_get_date;
         gcab_file_get_size;
 } LIBGCAB1_0.5;
+
+LIBGCAB1_1.0 {
+        gcab_folder_get_comptype;
+} LIBGCAB1_0.6;


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