[gcab] file: move attributes to public header



commit 68bde4526a6e912564ba8931e75cf4bcd6557e0e
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Thu Mar 12 22:13:12 2015 +0100

    file: move attributes to public header

 libgcab/cabinet.h   |    7 -------
 libgcab/gcab-file.c |    2 +-
 libgcab/gcab-file.h |   19 +++++++++++++++++++
 3 files changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/libgcab/cabinet.h b/libgcab/cabinet.h
index 6bb1f4e..299eb68 100644
--- a/libgcab/cabinet.h
+++ b/libgcab/cabinet.h
@@ -31,13 +31,6 @@ typedef struct cdata cdata_t;
 
 #define DATABLOCKSIZE           32768
 
-#define  CABINET_RDONLY         0x01  /* file is read-only */
-#define  CABINET_HIDDEN         0x02  /* file is hidden */
-#define  CABINET_SYSTEM         0x04  /* file is a system file */
-#define  CABINET_ARCH           0x20  /* file modified since last backup */
-#define  CABINET_EXEC           0x40  /* run after extraction */
-#define  CABINET_NAME_IS_UTF    0x80  /* szName[] contains UTF */
-
 #define CFO_START               0x24           /* folder offset */
 #define CFI_START               0x2C   /* file offset */
 
diff --git a/libgcab/gcab-file.c b/libgcab/gcab-file.c
index e998537..af77dd1 100644
--- a/libgcab/gcab-file.c
+++ b/libgcab/gcab-file.c
@@ -140,7 +140,7 @@ gcab_file_update_info (GCabFile *self, GFileInfo *info)
 
     self->cfile.name = self->name;
     self->cfile.usize = g_file_info_get_size (info);
-    self->cfile.fattr = CABINET_ARCH;
+    self->cfile.fattr = GCAB_FILE_ATTRIBUTE_ARCH;
     self->cfile.date = ((m->tm_year + 1900 - 1980 ) << 9 ) +
         ((m->tm_mon+1) << 5 ) + (m->tm_mday);
     self->cfile.time = (m->tm_hour << 11) + (m->tm_min << 5) + (m->tm_sec / 2);
diff --git a/libgcab/gcab-file.h b/libgcab/gcab-file.h
index d26ac51..a1485a7 100644
--- a/libgcab/gcab-file.h
+++ b/libgcab/gcab-file.h
@@ -35,6 +35,25 @@ G_BEGIN_DECLS
 typedef struct _GCabFileClass GCabFileClass;
 
 /**
+ * GCabFileAttribute:
+ * @GCAB_FILE_ATTRIBUTE_RDONLY: file is read-only
+ * @GCAB_FILE_ATTRIBUTE_HIDDEN: file is hidden
+ * @GCAB_FILE_ATTRIBUTE_SYSTEM: file is a system file
+ * @GCAB_FILE_ATTRIBUTE_ARCH: file modified since last backup
+ * @GCAB_FILE_ATTRIBUTE_EXEC: run after extraction
+ * @GCAB_FILE_ATTRIBUTE_NAME_IS_UTF: name contains UTF
+ **/
+typedef enum
+{
+  GCAB_FILE_ATTRIBUTE_RDONLY      = 0x01,
+  GCAB_FILE_ATTRIBUTE_HIDDEN      = 0x02,
+  GCAB_FILE_ATTRIBUTE_SYSTEM      = 0x04,
+  GCAB_FILE_ATTRIBUTE_ARCH        = 0x20,
+  GCAB_FILE_ATTRIBUTE_EXEC        = 0x40,
+  GCAB_FILE_ATTRIBUTE_NAME_IS_UTF = 0x80
+} GCabFileAttribute;
+
+/**
  * GCabFile:
  *
  * An opaque object, referencing a file in a Cabinet.


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