index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2012-01-11 15:39:52 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-01-18 22:10:06 -0600 |
commit | b3612e9cc198f198b3806efa461bf6fc04dd4502 (patch) | |
tree | 85d6018836a02c4ed4cb1211d3ec73d34a2259c9 /lib/libalpm/handle.c | |
parent | 6e8ca48cbb22c328deab56b1740be04ea7ddba6e (diff) |
-rw-r--r-- | lib/libalpm/handle.c | 12 |
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 8e2e3c73..2187dca9 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -43,6 +43,7 @@ alpm_handle_t *_alpm_handle_new(void) alpm_handle_t *handle; CALLOC(handle, 1, sizeof(alpm_handle_t), return NULL); + handle->deltaratio = 0.0; return handle; } @@ -252,10 +253,10 @@ const char SYMEXPORT *alpm_option_get_arch(alpm_handle_t *handle) return handle->arch; } -int SYMEXPORT alpm_option_get_usedelta(alpm_handle_t *handle) +double SYMEXPORT alpm_option_get_deltaratio(alpm_handle_t *handle) { CHECK_HANDLE(handle, return -1); - return handle->usedelta; + return handle->deltaratio; } int SYMEXPORT alpm_option_get_checkspace(alpm_handle_t *handle) @@ -597,10 +598,13 @@ int SYMEXPORT alpm_option_set_arch(alpm_handle_t *handle, const char *arch) return 0; } -int SYMEXPORT alpm_option_set_usedelta(alpm_handle_t *handle, int usedelta) +int SYMEXPORT alpm_option_set_deltaratio(alpm_handle_t *handle, double ratio) { CHECK_HANDLE(handle, return -1); - handle->usedelta = usedelta; + if(ratio < 0.0 || ratio > 2.0) { + RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1); + } + handle->deltaratio = ratio; return 0; } |