summaryrefslogtreecommitdiffstats
path: root/perl-install/c.pm
blob: 8022d009515d85e5b51bc50a0a90871a486afdc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package c; # $Id: c.pm 210307 2004-12-13 15:56:00Z tvignaud $

use vars qw($AUTOLOAD);

use c::stuff;
use MDK::Common;

sub AUTOLOAD() {
    $AUTOLOAD =~ /::(.*)/ or return;
    my $fct = $1;
    my @l = eval { &{$c::stuff::{$fct}} };
    if (my $err = $@) {
	$err =~ /Undefined subroutine &main::/ ?
	  die("cannot find function $AUTOLOAD\n" . backtrace()) :
	  die("$fct: " . $err);	
    }
    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