diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:50:21 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:50:21 +0000 |
commit | 9a2460bf025eda5bc00dad4ceac8a1d26ccc1d94 (patch) | |
tree | 68fe735733b80616c00b61501040564e91a1ff63 /URPM.xs | |
parent | 95d94d2ccd8443efd904586580e553750bf60c9d (diff) | |
download | perl-URPM-9a2460bf025eda5bc00dad4ceac8a1d26ccc1d94.tar perl-URPM-9a2460bf025eda5bc00dad4ceac8a1d26ccc1d94.tar.gz perl-URPM-9a2460bf025eda5bc00dad4ceac8a1d26ccc1d94.tar.bz2 perl-URPM-9a2460bf025eda5bc00dad4ceac8a1d26ccc1d94.tar.xz perl-URPM-9a2460bf025eda5bc00dad4ceac8a1d26ccc1d94.zip |
alias many flags accessors in order to save code
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 67 |
1 files changed, 18 insertions, 49 deletions
@@ -2310,14 +2310,6 @@ Pkg_set_flag(pkg, name, value=1) RETVAL int -Pkg_flag_skip(pkg) - URPM::Package pkg - CODE: - RETVAL = pkg->flag & FLAG_SKIP; - OUTPUT: - RETVAL - -int Pkg_set_flag_skip(pkg, value=1) URPM::Package pkg int value @@ -2329,14 +2321,6 @@ Pkg_set_flag_skip(pkg, value=1) RETVAL int -Pkg_flag_base(pkg) - URPM::Package pkg - CODE: - RETVAL = pkg->flag & FLAG_BASE; - OUTPUT: - RETVAL - -int Pkg_set_flag_base(pkg, value=1) URPM::Package pkg int value @@ -2348,14 +2332,6 @@ Pkg_set_flag_base(pkg, value=1) RETVAL int -Pkg_flag_disable_obsolete(pkg) - URPM::Package pkg - CODE: - RETVAL = pkg->flag & FLAG_DISABLE_OBSOLETE; - OUTPUT: - RETVAL - -int Pkg_set_flag_disable_obsolete(pkg, value=1) URPM::Package pkg int value @@ -2367,14 +2343,6 @@ Pkg_set_flag_disable_obsolete(pkg, value=1) RETVAL int -Pkg_flag_installed(pkg) - URPM::Package pkg - CODE: - RETVAL = pkg->flag & FLAG_INSTALLED; - OUTPUT: - RETVAL - -int Pkg_set_flag_installed(pkg, value=1) URPM::Package pkg int value @@ -2386,14 +2354,6 @@ Pkg_set_flag_installed(pkg, value=1) RETVAL int -Pkg_flag_requested(pkg) - URPM::Package pkg - CODE: - RETVAL = pkg->flag & FLAG_REQUESTED; - OUTPUT: - RETVAL - -int Pkg_set_flag_requested(pkg, value=1) URPM::Package pkg int value @@ -2407,8 +2367,25 @@ Pkg_set_flag_requested(pkg, value=1) int Pkg_flag_required(pkg) URPM::Package pkg + ALIAS: + flag_upgrade = 1 + flag_disable_obsolete = 2 + flag_requested = 3 + flag_installed = 4 + flag_base = 5 + flag_skip = 6 CODE: - RETVAL = pkg->flag & FLAG_REQUIRED; + unsigned flag; + switch (ix) { + case 0: flag = FLAG_REQUIRED; break; + case 1: flag = FLAG_UPGRADE; break; + case 2: flag = FLAG_DISABLE_OBSOLETE; break; + case 3: flag = FLAG_REQUESTED; break; + case 4: flag = FLAG_INSTALLED; break; + case 5: flag = FLAG_BASE; break; + case 6: flag = FLAG_SKIP; break; + } + RETVAL = pkg->flag & flag; OUTPUT: RETVAL @@ -2424,14 +2401,6 @@ Pkg_set_flag_required(pkg, value=1) RETVAL int -Pkg_flag_upgrade(pkg) - URPM::Package pkg - CODE: - RETVAL = pkg->flag & FLAG_UPGRADE; - OUTPUT: - RETVAL - -int Pkg_set_flag_upgrade(pkg, value=1) URPM::Package pkg int value |