]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Remove the unused system types from the public headers. We stripped
authorTim Kientzle <kientzle@gmail.com>
Thu, 12 Jan 2012 06:20:17 +0000 (01:20 -0500)
committerTim Kientzle <kientzle@gmail.com>
Thu, 12 Jan 2012 06:20:17 +0000 (01:20 -0500)
out almost all of the system-specific ino_t, uid_t, gid_t, etc, types
from the libarchive public API, so these definitions are no longer
needed.
In practice, those types are broken on enough systems that it just
wasn't worth trying to use them.

SVN-Revision: 4137

libarchive/archive.h
libarchive/archive_entry.h

index a59aa1e6b2ba69067df7bb9457bb16e8a60bbf01..4b899fe39baab1ce8b2b2590e28be539e9fa100b 100644 (file)
 # else
 #  define      __LA_SSIZE_T    long
 # endif
-# if defined(__BORLANDC__)
-#  define      __LA_UID_T      uid_t
-#  define      __LA_GID_T      gid_t
-# else
-#  define      __LA_UID_T      short
-#  define      __LA_GID_T      short
-# endif
 #else
-# include <unistd.h>  /* ssize_t, uid_t, and gid_t */
+# include <unistd.h>  /* ssize_t */
 # if defined(_SCO_DS)
 #  define      __LA_INT64_T    long long
 # else
 #  define      __LA_INT64_T    int64_t
 # endif
 # define       __LA_SSIZE_T    ssize_t
-# define       __LA_UID_T      uid_t
-# define       __LA_GID_T      gid_t
 #endif
 
 /*
@@ -818,8 +809,6 @@ __LA_DECL int                archive_file_count(struct archive *);
 
 /* These are meaningless outside of this header. */
 #undef __LA_DECL
-#undef __LA_GID_T
-#undef __LA_UID_T
 
 /* These need to remain defined because they're used in the
  * callback type definitions.  XXX Fix this.  This is ugly. XXX */
index 1db2ee1f2bd4175d1d599375b12fe8cf64544bd9..3a3857a549485d74283697f4f86698135e97f7d4 100644 (file)
 #include <windows.h>
 #endif
 
-/* Get appropriate definitions of standard POSIX-style types. */
-/* These should match the types used in 'struct stat' */
+/* Get a suitable 64-bit integer type. */
 #if defined(_WIN32) && !defined(__CYGWIN__)
-#define        __LA_INT64_T    __int64
-# if defined(__BORLANDC__)
-#  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  /* 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
+# define       __LA_INT64_T    __int64
 #else
 #include <unistd.h>
 # if defined(_SCO_DS)
 # else
 #  define      __LA_INT64_T    int64_t
 # endif
-# 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
 
-/*
- * Remove this for libarchive 3.2, since ino_t is no longer used.
- */
-#define        __LA_INO_T      ino_t
-
+/* Get a suitable definition for mode_t */
+#if ARCHIVE_VERSION_NUMBER >= 3999000
+/* Switch to plain 'int' for libarchive 4.0.  It's less broken than 'mode_t' */
+# define       __LA_MODE_T     int
+#elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__)
+# define       __LA_MODE_T     unsigned short
+#else
+# define       __LA_MODE_T     mode_t
+#endif
 
 /*
  * On Windows, define LIBARCHIVE_STATIC if you're building or using a
@@ -149,6 +137,10 @@ struct archive_entry;
  * portable values to platform-native values when entries are read from
  * or written to disk.
  */
+/*
+ * In libarchive 4.0, we can drop the casts here.
+ * They're needed to work around Borland C's broken mode_t.
+ */
 #define AE_IFMT                ((__LA_MODE_T)0170000)
 #define AE_IFREG       ((__LA_MODE_T)0100000)
 #define AE_IFLNK       ((__LA_MODE_T)0120000)
@@ -321,7 +313,10 @@ __LA_DECL int      archive_entry_update_uname_utf8(struct archive_entry *, const char
  * manipulate archives on systems different than the ones they were
  * created on.
  *
- * TODO: On Linux, provide both stat32 and stat64 versions of these functions.
+ * TODO: On Linux and other LFS systems, provide both stat32 and
+ * stat64 versions of these functions and all of the macro glue so
+ * that archive_entry_stat is magically defined to
+ * archive_entry_stat32 or archive_entry_stat64 as appropriate.
  */
 __LA_DECL const struct stat    *archive_entry_stat(struct archive_entry *);
 __LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *);