Commit 069b5683 069b5683ab5925ca91c93bf8eda71fa90729a248 by Sergey Poznyakoff

(sieve_load_add_path,sieve_load_add_dir): New functions.

1 parent 75b7e27e
......@@ -23,7 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <string.h>
#include <sieve.h>
#include <ltdl.h>
......@@ -96,6 +96,29 @@ sieve_load_ext (sieve_machine_t mach, const char *name)
return handle == NULL;
}
static int
_load_dir (void *item, void *unused)
{
return lt_dladdsearchdir (item);
}
int
sieve_load_add_path (list_t path)
{
if (lt_dlinit ())
return 1;
return list_do (path, _load_dir, NULL);
}
int
sieve_load_add_dir (sieve_machine_t mach, const char *name)
{
if (lt_dlinit ())
return 1;
sieve_machine_add_destructor (mach, (sieve_destructor_t) lt_dlexit, NULL);
return lt_dladdsearchdir (name);
}
#else
#include <sieve.h>
......@@ -105,4 +128,16 @@ sieve_load_ext (sieve_machine_t mach, const char *name)
return 1;
}
int
sieve_load_add_path (list_t path)
{
return 1;
}
int
sieve_load_add_dir (sieve_machine_t mach, const char *name)
{
return 1;
}
#endif /* HAVE_LIBLTDL */
......
......@@ -133,3 +133,6 @@ void instr_brz __P((sieve_machine_t mach));
int sieve_mark_deleted __P((message_t msg, int deleted));
int sieve_match_part_checker __P((const char *name, list_t tags, list_t args));
int sieve_load_add_path __P((list_t path));
int sieve_load_add_dir __P((sieve_machine_t mach, const char *name));
......