* Functions for reading fields from an archive_entry.
*/
-time_t
+__LA_TIME_T
archive_entry_atime(struct archive_entry *entry)
{
return (entry->ae_stat.aest_atime);
return (entry->ae_set & AE_SET_ATIME);
}
-time_t
+__LA_TIME_T
archive_entry_birthtime(struct archive_entry *entry)
{
return (entry->ae_stat.aest_birthtime);
return (entry->ae_set & AE_SET_BIRTHTIME);
}
-time_t
+__LA_TIME_T
archive_entry_ctime(struct archive_entry *entry)
{
return (entry->ae_stat.aest_ctime);
return (entry->ae_stat.aest_ctime_nsec);
}
-dev_t
+__LA_DEV_T
archive_entry_dev(struct archive_entry *entry)
{
if (entry->ae_stat.aest_dev_is_broken_down)
return (entry->ae_set & AE_SET_DEV);
}
-dev_t
+__LA_DEV_T
archive_entry_devmajor(struct archive_entry *entry)
{
if (entry->ae_stat.aest_dev_is_broken_down)
return major(entry->ae_stat.aest_dev);
}
-dev_t
+__LA_DEV_T
archive_entry_devminor(struct archive_entry *entry)
{
if (entry->ae_stat.aest_dev_is_broken_down)
return (entry->acl.mode);
}
-time_t
+__LA_TIME_T
archive_entry_mtime(struct archive_entry *entry)
{
return (entry->ae_stat.aest_mtime);
return (entry->ae_set & AE_SET_RDEV);
}
-dev_t
+__LA_DEV_T
archive_entry_rdev(struct archive_entry *entry)
{
if (archive_entry_rdev_is_set(entry)) {
}
}
-dev_t
+__LA_DEV_T
archive_entry_rdevmajor(struct archive_entry *entry)
{
if (archive_entry_rdev_is_set(entry)) {
}
}
-dev_t
+__LA_DEV_T
archive_entry_rdevminor(struct archive_entry *entry)
{
if (archive_entry_rdev_is_set(entry)) {
}
void
-archive_entry_set_atime(struct archive_entry *entry, time_t t, long ns)
+archive_entry_set_atime(struct archive_entry *entry, __LA_TIME_T t, long ns)
{
FIX_NS(t, ns);
entry->stat_valid = 0;
}
void
-archive_entry_set_birthtime(struct archive_entry *entry, time_t t, long ns)
+archive_entry_set_birthtime(struct archive_entry *entry, __LA_TIME_T t, long ns)
{
FIX_NS(t, ns);
entry->stat_valid = 0;
}
void
-archive_entry_set_ctime(struct archive_entry *entry, time_t t, long ns)
+archive_entry_set_ctime(struct archive_entry *entry, __LA_TIME_T t, long ns)
{
FIX_NS(t, ns);
entry->stat_valid = 0;
}
void
-archive_entry_set_dev(struct archive_entry *entry, dev_t d)
+archive_entry_set_dev(struct archive_entry *entry, __LA_DEV_T d)
{
entry->stat_valid = 0;
entry->ae_set |= AE_SET_DEV;
}
void
-archive_entry_set_devmajor(struct archive_entry *entry, dev_t m)
+archive_entry_set_devmajor(struct archive_entry *entry, __LA_DEV_T m)
{
entry->stat_valid = 0;
entry->ae_set |= AE_SET_DEV;
}
void
-archive_entry_set_devminor(struct archive_entry *entry, dev_t m)
+archive_entry_set_devminor(struct archive_entry *entry, __LA_DEV_T m)
{
entry->stat_valid = 0;
entry->ae_set |= AE_SET_DEV;
}
void
-archive_entry_set_mtime(struct archive_entry *entry, time_t t, long ns)
+archive_entry_set_mtime(struct archive_entry *entry, __LA_TIME_T t, long ns)
{
FIX_NS(t, ns);
entry->stat_valid = 0;
}
void
-archive_entry_set_rdev(struct archive_entry *entry, dev_t m)
+archive_entry_set_rdev(struct archive_entry *entry, __LA_DEV_T m)
{
entry->stat_valid = 0;
entry->ae_stat.aest_rdev = m;
}
void
-archive_entry_set_rdevmajor(struct archive_entry *entry, dev_t m)
+archive_entry_set_rdevmajor(struct archive_entry *entry, __LA_DEV_T m)
{
entry->stat_valid = 0;
entry->ae_stat.aest_rdev_is_broken_down = 1;
}
void
-archive_entry_set_rdevminor(struct archive_entry *entry, dev_t m)
+archive_entry_set_rdevminor(struct archive_entry *entry, __LA_DEV_T m)
{
entry->stat_valid = 0;
entry->ae_stat.aest_rdev_is_broken_down = 1;
#include <sys/types.h>
#include <stddef.h> /* for wchar_t */
#include <stdint.h>
+#if ARCHIVE_VERSION_NUMBER < 4000000
+/* time_t is slated to be removed from public includes in 4.0 */
#include <time.h>
+#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
# define __LA_MODE_T mode_t
#endif
+#if ARCHIVE_VERSION_NUMBER < 4000000
+/* Use the platform types for time_t */
+#define __LA_TIME_T time_t
+#else
+/* Use 64-bytes integer types for time_t */
+#define __LA_TIME_T la_int64_t
+#endif
+
+#if ARCHIVE_VERSION_NUMBER < 4000000
+/* Use the platform types for dev_t */
+#define __LA_DEV_T dev_t
+#else
+/* Use 64-bytes integer types for dev_t */
+#define __LA_DEV_T la_int64_t
+#endif
+
/* Large file support for Android */
#if defined(__LIBARCHIVE_BUILD) && defined(__ANDROID__)
#include "android_lf.h"
* also return NULL when implicit character set conversions fail.
* This is usually what you want.
*/
-__LA_DECL time_t archive_entry_atime(struct archive_entry *);
+__LA_DECL __LA_TIME_T archive_entry_atime(struct archive_entry *);
__LA_DECL long archive_entry_atime_nsec(struct archive_entry *);
__LA_DECL int archive_entry_atime_is_set(struct archive_entry *);
-__LA_DECL time_t archive_entry_birthtime(struct archive_entry *);
+__LA_DECL __LA_TIME_T archive_entry_birthtime(struct archive_entry *);
__LA_DECL long archive_entry_birthtime_nsec(struct archive_entry *);
__LA_DECL int archive_entry_birthtime_is_set(struct archive_entry *);
-__LA_DECL time_t archive_entry_ctime(struct archive_entry *);
+__LA_DECL __LA_TIME_T archive_entry_ctime(struct archive_entry *);
__LA_DECL long archive_entry_ctime_nsec(struct archive_entry *);
__LA_DECL int archive_entry_ctime_is_set(struct archive_entry *);
-__LA_DECL dev_t archive_entry_dev(struct archive_entry *);
+__LA_DECL __LA_DEV_T archive_entry_dev(struct archive_entry *);
__LA_DECL int archive_entry_dev_is_set(struct archive_entry *);
-__LA_DECL dev_t archive_entry_devmajor(struct archive_entry *);
-__LA_DECL dev_t archive_entry_devminor(struct archive_entry *);
+__LA_DECL __LA_DEV_T archive_entry_devmajor(struct archive_entry *);
+__LA_DECL __LA_DEV_T archive_entry_devminor(struct archive_entry *);
__LA_DECL __LA_MODE_T archive_entry_filetype(struct archive_entry *);
__LA_DECL int archive_entry_filetype_is_set(struct archive_entry *);
__LA_DECL void archive_entry_fflags(struct archive_entry *,
__LA_DECL __LA_MODE_T archive_entry_perm(struct archive_entry *);
__LA_DECL int archive_entry_perm_is_set(struct archive_entry *);
__LA_DECL int archive_entry_rdev_is_set(struct archive_entry *);
-__LA_DECL dev_t archive_entry_rdev(struct archive_entry *);
-__LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *);
-__LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *);
+__LA_DECL __LA_DEV_T archive_entry_rdev(struct archive_entry *);
+__LA_DECL __LA_DEV_T archive_entry_rdevmajor(struct archive_entry *);
+__LA_DECL __LA_DEV_T archive_entry_rdevminor(struct archive_entry *);
__LA_DECL const char *archive_entry_sourcepath(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_sourcepath_w(struct archive_entry *);
__LA_DECL la_int64_t archive_entry_size(struct archive_entry *);
* always copied.
*/
-__LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_set_atime(struct archive_entry *, __LA_TIME_T, long);
__LA_DECL void archive_entry_unset_atime(struct archive_entry *);
#if defined(_WIN32) && !defined(__CYGWIN__)
__LA_DECL void archive_entry_copy_bhfi(struct archive_entry *, BY_HANDLE_FILE_INFORMATION *);
#endif
-__LA_DECL void archive_entry_set_birthtime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_set_birthtime(struct archive_entry *, __LA_TIME_T, long);
__LA_DECL void archive_entry_unset_birthtime(struct archive_entry *);
-__LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_set_ctime(struct archive_entry *, __LA_TIME_T, long);
__LA_DECL void archive_entry_unset_ctime(struct archive_entry *);
-__LA_DECL void archive_entry_set_dev(struct archive_entry *, dev_t);
-__LA_DECL void archive_entry_set_devmajor(struct archive_entry *, dev_t);
-__LA_DECL void archive_entry_set_devminor(struct archive_entry *, dev_t);
+__LA_DECL void archive_entry_set_dev(struct archive_entry *, __LA_DEV_T);
+__LA_DECL void archive_entry_set_devmajor(struct archive_entry *, __LA_DEV_T);
+__LA_DECL void archive_entry_set_devminor(struct archive_entry *, __LA_DEV_T);
__LA_DECL void archive_entry_set_filetype(struct archive_entry *, unsigned int);
__LA_DECL void archive_entry_set_fflags(struct archive_entry *,
unsigned long /* set */, unsigned long /* clear */);
__LA_DECL void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *);
__LA_DECL int archive_entry_update_link_utf8(struct archive_entry *, const char *);
__LA_DECL void archive_entry_set_mode(struct archive_entry *, __LA_MODE_T);
-__LA_DECL void archive_entry_set_mtime(struct archive_entry *, time_t, long);
+__LA_DECL void archive_entry_set_mtime(struct archive_entry *, __LA_TIME_T, long);
__LA_DECL void archive_entry_unset_mtime(struct archive_entry *);
__LA_DECL void archive_entry_set_nlink(struct archive_entry *, unsigned int);
__LA_DECL void archive_entry_set_pathname(struct archive_entry *, const char *);
__LA_DECL void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *);
__LA_DECL int archive_entry_update_pathname_utf8(struct archive_entry *, const char *);
__LA_DECL void archive_entry_set_perm(struct archive_entry *, __LA_MODE_T);
-__LA_DECL void archive_entry_set_rdev(struct archive_entry *, dev_t);
-__LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, dev_t);
-__LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, dev_t);
+__LA_DECL void archive_entry_set_rdev(struct archive_entry *, __LA_DEV_T);
+__LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, __LA_DEV_T);
+__LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, __LA_DEV_T);
__LA_DECL void archive_entry_set_size(struct archive_entry *, la_int64_t);
__LA_DECL void archive_entry_unset_size(struct archive_entry *);
__LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *);