aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-27 14:55:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-27 14:55:38 +0000
commit81be3d9495ae64a83e4c3522bcbeaf83f4e8508e (patch)
tree3dfff952a51fd6e6a6bd3d99b71c10af5d884397
parent6a768c186358f6e39647001acff9f2d01761b554 (diff)
downloadperl-URPM-81be3d9495ae64a83e4c3522bcbeaf83f4e8508e.tar
perl-URPM-81be3d9495ae64a83e4c3522bcbeaf83f4e8508e.tar.gz
perl-URPM-81be3d9495ae64a83e4c3522bcbeaf83f4e8508e.tar.bz2
perl-URPM-81be3d9495ae64a83e4c3522bcbeaf83f4e8508e.tar.xz
perl-URPM-81be3d9495ae64a83e4c3522bcbeaf83f4e8508e.zip
revert previous commit (not useful) and create update_hash_entry() doing what
update_provides_entry() do (for next commit)
-rw-r--r--URPM.xs21
1 files changed, 8 insertions, 13 deletions
diff --git a/URPM.xs b/URPM.xs
index 3b74013..e090558 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -803,7 +803,8 @@ pack_header(URPM__Package pkg) {
}
}
-static SV** update_hash_entry(HV *hash, char *name, STRLEN len, int force) {
+static void
+update_hash_entry(HV *hash, char *name, STRLEN len, int force, IV use_sense, URPM__Package pkg) {
SV** isv;
if (!len) len = strlen(name);
@@ -819,24 +820,18 @@ static SV** update_hash_entry(HV *hash, char *name, STRLEN len, int force) {
}
}
}
- return isv;
- } else {
- return NULL;
- }
-}
-
-static void
-update_provide_entry(char *name, STRLEN len, int force, IV use_sense, URPM__Package pkg, HV *provides) {
- SV** isv;
-
- isv = update_hash_entry(provides, name, len, force);
-
if (isv && *isv != &PL_sv_undef) {
char id[8];
STRLEN id_len = snprintf(id, sizeof(id), "%d", pkg->flag & FLAG_ID);
SV **sense = hv_fetch((HV*)SvRV(*isv), id, id_len, 1);
if (sense && use_sense) sv_setiv(*sense, use_sense);
}
+ }
+}
+
+static void
+update_provides_entry(char *name, STRLEN len, int force, IV use_sense, URPM__Package pkg, HV *provides) {
+ update_hash_entry(provides, name, len, force, use_sense, pkg);
}
static void