+
=head1 Introduction
This is a sample Perl module for the OpenLDAP server slapd.
package SampleLDAP;
+use POSIX;
+
sub new
{
my $class = shift;
my $this = {};
bless $this, $class;
-
+ print STDERR "Here in new\n";
+ print STDERR "Posix Var " . BUFSIZ . " and " . FILENAME_MAX . "\n";
return $this;
}
{
my $this = shift;
my( $filterStr, $sizeLim, $timeLim, $attrOnly, @attrs ) = @_;
-
+ print STDERR "====$filterStr====\n";
$filterStr =~ s/\(|\)//g;
$filterStr =~ s/=/: /;
my ( $dn ) = @_;
+ print STDERR "XXXXXX $dn XXXXXXX\n";
delete $this->{$dn};
}
my $this = shift;
my ( @args ) = @_;
-
- return 1;
+ local $, = " - ";
+ print STDERR @args;
+ print STDERR "\n";
+ return 0;
}
1;
#include "perl_back.h"
+LDAP_F( void )
+perl_back_xs_init LDAP_P((void));
+LDAP_F( void )
+boot_DynaLoader LDAP_P((CV* cv));
PerlInterpreter *perl_interpreter = NULL;
ldap_pvt_thread_mutex_t perl_interpreter_mutex;
perl_interpreter = perl_alloc();
perl_construct(perl_interpreter);
- perl_parse(perl_interpreter, NULL, 3, embedding, (char **)NULL);
+ perl_parse(perl_interpreter, perl_back_xs_init, 3, embedding, (char **)NULL);
perl_run(perl_interpreter);
bi->bi_open = perl_back_open;
return 0;
}
+
+static void
+perl_back_xs_init()
+{
+ char *file = __FILE__;
+ dXSUB_SYS;
+ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
+}