23 |
#include <stdio.h> |
#include <stdio.h> |
24 |
#include <stdlib.h> |
#include <stdlib.h> |
25 |
#include <unistd.h> |
#include <unistd.h> |
26 |
#include <string.h> |
#include <string.h> |
27 |
#include <sieve.h> |
#include <sieve.h> |
28 |
#include <ltdl.h> |
#include <ltdl.h> |
29 |
|
|
96 |
return handle == NULL; |
return handle == NULL; |
97 |
} |
} |
98 |
|
|
99 |
|
static int |
100 |
|
_load_dir (void *item, void *unused) |
101 |
|
{ |
102 |
|
return lt_dladdsearchdir (item); |
103 |
|
} |
104 |
|
|
105 |
|
int |
106 |
|
sieve_load_add_path (list_t path) |
107 |
|
{ |
108 |
|
if (lt_dlinit ()) |
109 |
|
return 1; |
110 |
|
return list_do (path, _load_dir, NULL); |
111 |
|
} |
112 |
|
|
113 |
|
int |
114 |
|
sieve_load_add_dir (sieve_machine_t mach, const char *name) |
115 |
|
{ |
116 |
|
if (lt_dlinit ()) |
117 |
|
return 1; |
118 |
|
sieve_machine_add_destructor (mach, (sieve_destructor_t) lt_dlexit, NULL); |
119 |
|
return lt_dladdsearchdir (name); |
120 |
|
} |
121 |
|
|
122 |
#else |
#else |
123 |
#include <sieve.h> |
#include <sieve.h> |
124 |
|
|
127 |
{ |
{ |
128 |
return 1; |
return 1; |
129 |
} |
} |
130 |
|
|
131 |
|
int |
132 |
|
sieve_load_add_path (list_t path) |
133 |
|
{ |
134 |
|
return 1; |
135 |
|
} |
136 |
|
|
137 |
|
int |
138 |
|
sieve_load_add_dir (sieve_machine_t mach, const char *name) |
139 |
|
{ |
140 |
|
return 1; |
141 |
|
} |
142 |
|
|
143 |
#endif /* HAVE_LIBLTDL */ |
#endif /* HAVE_LIBLTDL */ |