From 0669c9bfac7aead01f1400444e691d542f7645c2 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 1 Jun 2008 21:47:31 -0500 Subject: 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 --- lib/libalpm/package.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/libalpm/package.h') 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 +#include /* off_t */ +#include /* 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); -- cgit v1.2.3-70-g09d2