diff options
author | Dan McGee <dan@archlinux.org> | 2008-06-02 04:47:31 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-06-04 22:38:47 +0200 |
commit | 0669c9bfac7aead01f1400444e691d542f7645c2 (patch) | |
tree | f5dc76963236bd50126d7b4e570969c14e066a03 /lib/libalpm/package.h | |
parent | 62b4195c7680f9d404e175eb0869182efdd09ef2 (diff) | |
download | pacman-0669c9bfac7aead01f1400444e691d542f7645c2.tar.gz pacman-0669c9bfac7aead01f1400444e691d542f7645c2.tar.xz |
Use correct C type for file sizes
We have been using unsigned long as a file size type for a while, which
works but isn't quite correct and could easily break. Worse was probably our
use of int in the download callback functions, which could be restrictive
for packages > 2GB in size.
Switch all file size variables to use off_t, which is the preferred type for
file sizes. Note that at least on Linux, all applications compiled against
libalpm must now be sure to use large file support, where _FILE_OFFSET_BITS
is defined to be 64 or there will be some weird issues that crop up.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/package.h')
-rw-r--r-- | lib/libalpm/package.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index ddf1d073..d06cf150 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -23,7 +23,8 @@ #ifndef _ALPM_PACKAGE_H #define _ALPM_PACKAGE_H -#include <time.h> +#include <sys/types.h> /* off_t */ +#include <time.h> /* time_t */ #include "alpm.h" #include "db.h" @@ -44,8 +45,9 @@ struct __pmpkg_t { char *packager; char *md5sum; char *arch; - unsigned long size; - unsigned long isize; + off_t size; + off_t isize; + off_t download_size; unsigned short scriptlet; unsigned short force; pmpkgreason_t reason; @@ -59,6 +61,7 @@ struct __pmpkg_t { alpm_list_t *conflicts; alpm_list_t *provides; alpm_list_t *deltas; + alpm_list_t *delta_path; /* internal */ pmpkgfrom_t origin; /* Replaced 'void *data' with this union as follows: @@ -70,8 +73,6 @@ struct __pmpkg_t { char *file; } origin_data; pmdbinfrq_t infolevel; - unsigned long download_size; - alpm_list_t *delta_path; }; pmpkg_t* _alpm_pkg_new(void); |