From 5f3629bea0d4beb79c6092086b46f3d73643c76d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 7 Sep 2011 10:21:47 -0500 Subject: Introduce alpm_time_t type This will always be a 64-bit signed integer rather than the variable length time_t type. Dates beyond 2038 should be fully supported in the library; the frontend still lags behind because 32-bit platforms provide no localtime64() or equivalent function to convert from an epoch value to a broken down time structure. Signed-off-by: Dan McGee --- lib/libalpm/alpm.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'lib/libalpm/alpm.h') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index a93d4e3e..9fda9406 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -27,9 +27,9 @@ extern "C" { #endif -#include /* for off_t */ -#include /* for time_t */ -#include /* for va_list */ +#include /* int64_t */ +#include /* off_t */ +#include /* va_list */ #include @@ -44,6 +44,8 @@ extern "C" { * @{ */ +typedef int64_t alpm_time_t; + /* * Enumerations * These ones are used in multiple contexts, so are forward-declared. @@ -222,8 +224,8 @@ typedef struct _alpm_pgpkey_t { char *uid; char *name; char *email; - time_t created; - time_t expires; + alpm_time_t created; + alpm_time_t expires; } alpm_pgpkey_t; /** Signature result. Contains the key, status, and validity of a given @@ -754,13 +756,13 @@ const char *alpm_pkg_get_url(alpm_pkg_t *pkg); * @param pkg a pointer to package * @return the timestamp of the build time */ -time_t alpm_pkg_get_builddate(alpm_pkg_t *pkg); +alpm_time_t alpm_pkg_get_builddate(alpm_pkg_t *pkg); /** Returns the install timestamp of the package. * @param pkg a pointer to package * @return the timestamp of the install time */ -time_t alpm_pkg_get_installdate(alpm_pkg_t *pkg); +alpm_time_t alpm_pkg_get_installdate(alpm_pkg_t *pkg); /** Returns the packager's name. * @param pkg a pointer to package -- cgit v1.2.3-24-g4f1b