From: Tim Kientzle Date: Sat, 3 Jul 2010 22:12:20 +0000 (-0400) Subject: For libarchive 3.0, use int64_t instead of uid_t, gid_t, ino_t. X-Git-Tag: v3.0.0a~920 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c938a22db226d01fba9964cc2f5ccab9fabc8775;p=thirdparty%2Flibarchive.git For libarchive 3.0, use int64_t instead of uid_t, gid_t, ino_t. SVN-Revision: 2525 --- diff --git a/libarchive/archive_entry.c b/libarchive/archive_entry.c index b0b935f58..de8ebda53 100644 --- a/libarchive/archive_entry.c +++ b/libarchive/archive_entry.c @@ -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; diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h index 76a40ffe7..0ed44fec0 100644 --- a/libarchive/archive_entry.h +++ b/libarchive/archive_entry.h @@ -52,30 +52,27 @@ #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 #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 *); diff --git a/libarchive/archive_entry_private.h b/libarchive/archive_entry_private.h index e5d48efee..07d4450ff 100644 --- a/libarchive/archive_entry_private.h +++ b/libarchive/archive_entry_private.h @@ -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