aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-02-11 13:59:41 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-02-11 13:59:41 +0000
commit66c01d903344201469b7c74390ffb801cd4c56f9 (patch)
treeb2380644d7e662052045fa80672a229de3aa42f5 /URPM.xs
parent1da9c3b06209848ec5a9189763514fe7464dbe4e (diff)
downloadperl-URPM-66c01d903344201469b7c74390ffb801cd4c56f9.tar
perl-URPM-66c01d903344201469b7c74390ffb801cd4c56f9.tar.gz
perl-URPM-66c01d903344201469b7c74390ffb801cd4c56f9.tar.bz2
perl-URPM-66c01d903344201469b7c74390ffb801cd4c56f9.tar.xz
perl-URPM-66c01d903344201469b7c74390ffb801cd4c56f9.zip
Add macro handling code from Olivier Thauvin
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs30
1 files changed, 30 insertions, 0 deletions
diff --git a/URPM.xs b/URPM.xs
index d6f5b4e..86ad375 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -4095,4 +4095,34 @@ Urpm_stream2header(fp)
Fclose(fd);
}
+void
+expand(name)
+ char * name
+ PPCODE:
+ const char * value = rpmExpand(name, NULL);
+ XPUSHs(sv_2mortal(newSVpv(value, 0)));
+
+void
+add_macro(macro)
+ char * macro
+ CODE:
+ rpmDefineMacro(NULL, macro, RMIL_DEFAULT);
+
+void
+del_macro(name)
+ char * name
+ CODE:
+ delMacro(NULL, name);
+
+void
+loadmacrosfile(filename)
+ char * filename
+ PPCODE:
+ rpmInitMacros(NULL, filename);
+
+void
+resetmacros()
+ PPCODE:
+ rpmFreeMacros(NULL);
+
/* vim:set ts=8 sts=2 sw=2: */