diff options
Diffstat (limited to 'perl-install/c.pm')
-rw-r--r-- | perl-install/c.pm | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/perl-install/c.pm b/perl-install/c.pm index aa03b9b1e..8312c0d79 100644 --- a/perl-install/c.pm +++ b/perl-install/c.pm @@ -1,19 +1,48 @@ -package c; # $Id$ +package c; use vars qw($AUTOLOAD); use c::stuff; use MDK::Common; -sub AUTOLOAD { - $AUTOLOAD =~ /::(.*)/; - my @l = eval { &{$c::stuff::{$1}} }; +sub AUTOLOAD() { + $AUTOLOAD =~ /::(.*)/ or return; + my $fct = $1; + my @l = eval { &{$c::stuff::{$fct}} }; if (my $err = $@) { $err =~ /Undefined subroutine &main::/ ? - die("can't find function $AUTOLOAD\n" . backtrace()) : - die($err); + die("cannot find function $AUTOLOAD\n" . backtrace()) : + die("$fct: " . $err); } - wantarray ? @l : $l[0]; + wantarray() ? @l : $l[0]; } 1; + + +=head1 SYNOPSYS + +The C module is glue code between the Perl & the C worlds that enable drakx to: + +=over + +=item * + +access various C libraries, mainly libldetect + +=item * + +bind some C functions (eg: syslog(), ...) + +=item * + +implement in C some helper functions + +=back + +It is autogenerated from perl-install/c/stuff.xs.pl. +One needs to run "perl Makefile.PL" + +It's used quite a lot by L<detect_devices>. + +=cut |