]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
For libarchive 3.0, use int64_t instead of uid_t, gid_t, ino_t.
authorTim Kientzle <kientzle@gmail.com>
Sat, 3 Jul 2010 22:12:20 +0000 (18:12 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sat, 3 Jul 2010 22:12:20 +0000 (18:12 -0400)
SVN-Revision: 2525

libarchive/archive_entry.c
libarchive/archive_entry.h
libarchive/archive_entry_private.h

index b0b935f588fddc4846dc227a80d487a5b0508ff1..de8ebda53dbae74a4d55edec2c999834a89c0140 100644 (file)
@@ -559,8 +559,13 @@ archive_entry_fflags_text(struct archive_entry *entry)
        return (f);
 }
 
+#if ARCHIVE_VERSION_NUMBER < 3000000
 gid_t
 archive_entry_gid(struct archive_entry *entry)
+#else
+int64_t
+archive_entry_gid(struct archive_entry *entry)
+#endif
 {
        return (entry->ae_stat.aest_gid);
 }
@@ -723,8 +728,13 @@ archive_entry_symlink_w(struct archive_entry *entry)
        return (NULL);
 }
 
+#if ARCHIVE_VERSION_NUMBER < 3000000
 uid_t
 archive_entry_uid(struct archive_entry *entry)
+#else
+int64_t
+archive_entry_uid(struct archive_entry *entry)
+#endif
 {
        return (entry->ae_stat.aest_uid);
 }
@@ -780,8 +790,13 @@ archive_entry_copy_fflags_text_w(struct archive_entry *entry,
                    &entry->ae_fflags_set, &entry->ae_fflags_clear));
 }
 
+#if ARCHIVE_VERSION_NUMBER < 3000000
 void
 archive_entry_set_gid(struct archive_entry *entry, gid_t g)
+#else
+void
+archive_entry_set_gid(struct archive_entry *entry, int64_t g)
+#endif
 {
        entry->stat_valid = 0;
        entry->ae_stat.aest_gid = g;
@@ -1136,8 +1151,13 @@ archive_entry_update_symlink_utf8(struct archive_entry *entry, const char *linkn
        return (aes_update_utf8(&entry->ae_symlink, linkname));
 }
 
+#if ARCHIVE_VERSION_NUMBER < 3000000
 void
 archive_entry_set_uid(struct archive_entry *entry, uid_t u)
+#else
+void
+archive_entry_set_uid(struct archive_entry *entry, int64_t u)
+#endif
 {
        entry->stat_valid = 0;
        entry->ae_stat.aest_uid = u;
index 76a40ffe7b7e3bb9bc5ff4e2b590abec27565620..0ed44fec0791c00da5fc9b6277925a2d0adcfef5 100644 (file)
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #define        __LA_INT64_T    __int64
 # if defined(__BORLANDC__)
-#  define      __LA_UID_T      uid_t
-#  define      __LA_GID_T      gid_t
+#  define      __LA_UID_T      uid_t  /* Remove in libarchive 3.2 */
+#  define      __LA_GID_T      gid_t  /* Remove in libarchive 3.2 */
 #  define      __LA_DEV_T      dev_t
 #  define      __LA_MODE_T     mode_t
 # else
-#  define      __LA_UID_T      short
-#  define      __LA_GID_T      short
+#  define      __LA_UID_T      short  /* Remove in libarchive 3.2 */
+#  define      __LA_GID_T      short  /* Remove in libarchive 3.2 */
 #  define      __LA_DEV_T      unsigned int
 #  define      __LA_MODE_T     unsigned short
 # endif
 #else
 #include <unistd.h>
 #define        __LA_INT64_T    int64_t
-#define        __LA_UID_T      uid_t
-#define        __LA_GID_T      gid_t
+#define        __LA_UID_T      uid_t /* Remove in libarchive 3.2 */
+#define        __LA_GID_T      gid_t /* Remove in libarchive 3.2 */
 #define        __LA_DEV_T      dev_t
 #define        __LA_MODE_T     mode_t
 #endif
 
 /*
- * XXX Is this defined for all Windows compilers?  If so, in what
- * header?  It would be nice to remove the __LA_INO_T indirection and
- * just use plain ino_t everywhere.  Likewise for the other types just
- * above.
+ * Remove this for libarchive 3.2, since ino_t is no longer used.
  */
 #define        __LA_INO_T      ino_t
 
@@ -202,7 +199,11 @@ __LA_DECL void              archive_entry_fflags(struct archive_entry *,
                            unsigned long * /* set */,
                            unsigned long * /* clear */);
 __LA_DECL const char   *archive_entry_fflags_text(struct archive_entry *);
+#if ARCHIVE_VERSION_NUMBER < 3000000
 __LA_DECL __LA_GID_T    archive_entry_gid(struct archive_entry *);
+#else
+__LA_DECL __LA_INT64_T  archive_entry_gid(struct archive_entry *);
+#endif
 __LA_DECL const char   *archive_entry_gname(struct archive_entry *);
 __LA_DECL const wchar_t        *archive_entry_gname_w(struct archive_entry *);
 __LA_DECL const char   *archive_entry_hardlink(struct archive_entry *);
@@ -230,7 +231,11 @@ __LA_DECL int               archive_entry_size_is_set(struct archive_entry *);
 __LA_DECL const char   *archive_entry_strmode(struct archive_entry *);
 __LA_DECL const char   *archive_entry_symlink(struct archive_entry *);
 __LA_DECL const wchar_t        *archive_entry_symlink_w(struct archive_entry *);
+#if ARCHIVE_VERSION_NUMBER < 3000000
 __LA_DECL __LA_UID_T    archive_entry_uid(struct archive_entry *);
+#else
+__LA_DECL __LA_INT64_T  archive_entry_uid(struct archive_entry *);
+#endif
 __LA_DECL const char   *archive_entry_uname(struct archive_entry *);
 __LA_DECL const wchar_t        *archive_entry_uname_w(struct archive_entry *);
 
@@ -266,7 +271,11 @@ __LA_DECL const char *archive_entry_copy_fflags_text(struct archive_entry *,
            const char *);
 __LA_DECL const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *,
            const wchar_t *);
+#if ARCHIVE_VERSION_NUMBER < 3000000
 __LA_DECL void archive_entry_set_gid(struct archive_entry *, __LA_GID_T);
+#else
+__LA_DECL void archive_entry_set_gid(struct archive_entry *, __LA_INT64_T);
+#endif
 __LA_DECL void archive_entry_set_gname(struct archive_entry *, const char *);
 __LA_DECL void archive_entry_copy_gname(struct archive_entry *, const char *);
 __LA_DECL void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *);
@@ -304,7 +313,11 @@ __LA_DECL void     archive_entry_set_symlink(struct archive_entry *, const char *);
 __LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *);
 __LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *);
 __LA_DECL int  archive_entry_update_symlink_utf8(struct archive_entry *, const char *);
+#if ARCHIVE_VERSION_NUMBER < 3000000
 __LA_DECL void archive_entry_set_uid(struct archive_entry *, __LA_UID_T);
+#else
+__LA_DECL void archive_entry_set_uid(struct archive_entry *, __LA_INT64_T);
+#endif
 __LA_DECL void archive_entry_set_uname(struct archive_entry *, const char *);
 __LA_DECL void archive_entry_copy_uname(struct archive_entry *, const char *);
 __LA_DECL void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *);
index e5d48efee0df84eeda7ed77616866f7201e6cd92..07d4450fff32f39b9b99411a6457c1bc80ccb0c8 100644 (file)
@@ -125,12 +125,12 @@ struct archive_entry {
                uint32_t        aest_mtime_nsec;
                int64_t         aest_birthtime;
                uint32_t        aest_birthtime_nsec;
-               gid_t           aest_gid;
+               int64_t         aest_gid;
                int64_t         aest_ino;
                mode_t          aest_mode;
                uint32_t        aest_nlink;
                uint64_t        aest_size;
-               uid_t           aest_uid;
+               int64_t         aest_uid;
                /*
                 * Because converting between device codes and
                 * major/minor values is platform-specific and