(sieve_load_add_path,sieve_load_add_dir): New functions.
Showing
2 changed files
with
39 additions
and
1 deletions
... | @@ -23,7 +23,7 @@ | ... | @@ -23,7 +23,7 @@ |
23 | #include <stdio.h> | 23 | #include <stdio.h> |
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | #include <unistd.h> | 25 | #include <unistd.h> |
26 | #include <string.h> | 26 | #include <string.h> |
27 | #include <sieve.h> | 27 | #include <sieve.h> |
28 | #include <ltdl.h> | 28 | #include <ltdl.h> |
29 | 29 | ||
... | @@ -96,6 +96,29 @@ sieve_load_ext (sieve_machine_t mach, const char *name) | ... | @@ -96,6 +96,29 @@ sieve_load_ext (sieve_machine_t mach, const char *name) |
96 | return handle == NULL; | 96 | return handle == NULL; |
97 | } | 97 | } |
98 | 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 | |||
99 | #else | 122 | #else |
100 | #include <sieve.h> | 123 | #include <sieve.h> |
101 | 124 | ||
... | @@ -105,4 +128,16 @@ sieve_load_ext (sieve_machine_t mach, const char *name) | ... | @@ -105,4 +128,16 @@ sieve_load_ext (sieve_machine_t mach, const char *name) |
105 | return 1; | 128 | return 1; |
106 | } | 129 | } |
107 | 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 | |||
108 | #endif /* HAVE_LIBLTDL */ | 143 | #endif /* HAVE_LIBLTDL */ | ... | ... |
... | @@ -133,3 +133,6 @@ void instr_brz __P((sieve_machine_t mach)); | ... | @@ -133,3 +133,6 @@ void instr_brz __P((sieve_machine_t mach)); |
133 | int sieve_mark_deleted __P((message_t msg, int deleted)); | 133 | int sieve_mark_deleted __P((message_t msg, int deleted)); |
134 | 134 | ||
135 | int sieve_match_part_checker __P((const char *name, list_t tags, list_t args)); | 135 | int sieve_match_part_checker __P((const char *name, list_t tags, list_t args)); |
136 | |||
137 | int sieve_load_add_path __P((list_t path)); | ||
138 | int sieve_load_add_dir __P((sieve_machine_t mach, const char *name)); | ... | ... |
-
Please register or sign in to post a comment