Author: mvidner
Date: Wed Feb 4 16:11:18 2009
New Revision: 55255
URL: http://svn.opensuse.org/viewcvs/yast?rev=55255&view=rev
Log:
Added logging functions YaST::YCP::y2useritem and y2usernote (FATE#100386).
Modified:
trunk/perl-bindings/VERSION
trunk/perl-bindings/package/yast2-perl-bindings.changes
trunk/perl-bindings/src/YCP.cc
trunk/perl-bindings/src/YCP.pm
Modified: trunk/perl-bindings/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/VERSION?rev=55255&r1=55254&r2=55255&view=diff
==============================================================================
--- trunk/perl-bindings/VERSION (original)
+++ trunk/perl-bindings/VERSION Wed Feb 4 16:11:18 2009
@@ -1 +1 @@
-2.17.2
+2.18.0
Modified: trunk/perl-bindings/package/yast2-perl-bindings.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/package/yast2-perl-bindings.changes?rev=55255&r1=55254&r2=55255&view=diff
==============================================================================
--- trunk/perl-bindings/package/yast2-perl-bindings.changes (original)
+++ trunk/perl-bindings/package/yast2-perl-bindings.changes Wed Feb 4 16:11:18 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Feb 4 16:11:10 CET 2009 - mvidner@suse.cz
+
+- Added logging functions YaST::YCP::y2useritem and y2usernote (FATE#100386).
+- 2.18.0
+
+-------------------------------------------------------------------
Mon Sep 29 14:25:15 CEST 2008 - visnov@suse.cz
- Fixed testsuite
Modified: trunk/perl-bindings/src/YCP.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/src/YCP.cc?rev=55255&r1=55254&r2=55255&view=diff
==============================================================================
--- trunk/perl-bindings/src/YCP.cc (original)
+++ trunk/perl-bindings/src/YCP.cc Wed Feb 4 16:11:18 2009
@@ -4,6 +4,7 @@
* This is the path from Perl to YCP. It defines XSUBs.
*/
+#include
#include
#include
#include
@@ -64,6 +65,22 @@
XSRETURN_EMPTY;
}
+XS(XS_YCP_y2_changes_logger); /* prototype to pass -Wmissing-prototypes */
+XS(XS_YCP_y2_changes_logger)
+{
+ // defines "items", the number of arguments
+ dXSARGS;
+ if (items != 2)
+ {
+ y2internal ("y2_changes_logger must have 2 arguments");
+ XSRETURN_EMPTY;
+ }
+ logcategory_t level = (logcategory_t) SvIV (ST (0));
+ const char * message = SvPV_nolen (ST (1));
+ y2changes_function (level, "%s", message);
+ XSRETURN_EMPTY;
+}
+
XS(XS_YCP_call_ycp); /* prototype to pass -Wmissing-prototypes */
XS(XS_YCP_call_ycp)
{
@@ -482,7 +499,7 @@
dXSARGS;
// get rid of warning: unused variable `I32 items'
I32 __attribute__ ((unused)) foo = items;
- char* file = __FILE__;
+ const char* file = __FILE__;
XS_VERSION_BOOTCHECK ;
@@ -492,5 +509,6 @@
newXS("YaST::YCP::close_components", XS_YCP_close_components, file);
newXS("YaST::YCP::init_ui", XS_YCP_init_ui, file);
newXS("YaST::YCP::y2_logger", XS_YCP_y2_logger, file);
+ newXS("YaST::YCP::y2_changes_logger", XS_YCP_y2_changes_logger, file);
XSRETURN_YES;
}
Modified: trunk/perl-bindings/src/YCP.pm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/src/YCP.pm?rev=55255&r1=55254&r2=55255&view=diff
==============================================================================
--- trunk/perl-bindings/src/YCP.pm (original)
+++ trunk/perl-bindings/src/YCP.pm Wed Feb 4 16:11:18 2009
@@ -121,7 +121,7 @@
require Exporter;
our @ISA = qw(Exporter);
my @e_data = qw(Boolean Byteblock Integer Float String Symbol Term);
-my @e_logging = qw(y2debug y2milestone y2warning y2error y2security y2internal);
+my @e_logging = qw(y2debug y2milestone y2warning y2error y2security y2internal y2useritem y2usernote);
my @e_ui = qw(BarGraph Bottom CheckBox ColoredLabel ComboBox Date
DownloadProgress DumbTab DummySpecialWidget Empty Frame HBox HCenter
HMultiProgressMeter HSpacing HSquash HStretch HVCenter HVSquash
@@ -233,6 +233,13 @@
join (" ", @_));
}
+sub y2_changes_logger_helper ($@)
+{
+ my $level = shift;
+ # this is a XS:
+ y2_changes_logger ($level, join (" ", @_));
+}
+
sub y2debug (@) { y2_logger_helper (0, @_); }
sub y2milestone (@) { y2_logger_helper (1, @_); }
sub y2warning (@) { y2_logger_helper (2, @_); }
@@ -240,6 +247,9 @@
sub y2security (@) { y2_logger_helper (4, @_); }
sub y2internal (@) { y2_logger_helper (5, @_); }
+sub y2useritem (@) { y2_changes_logger_helper (0, @_); }
+sub y2usernote (@) { y2_changes_logger_helper (1, @_); }
+
=head2 sformat
Implements the sformat YCP builtin:
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org