-I$(top_srcdir)/src/lib-auth-client \
-I$(top_srcdir)/src/lib-test \
-I$(top_srcdir)/src/lib-json \
+ -I$(top_srcdir)/src/lib-ldap \
-I$(top_srcdir)/src/lib-dict \
-I$(top_srcdir)/src/lib-dns \
-I$(top_srcdir)/src/lib-http \
#include "db-ldap-settings.h"
/* <settings checks> */
+#include "ldap-settings-parse.h"
-#include "ldap.h"
static bool ldap_setting_check(void *_set, pool_t pool, const char **error_r);
-
/* </settings checks> */
#undef DEF
return 0;
}
-static int ldap_parse_scope(const char *str, int *scope_r)
-{
- if (strcasecmp(str, "base") == 0)
- *scope_r = LDAP_SCOPE_BASE;
- else if (strcasecmp(str, "onelevel") == 0)
- *scope_r = LDAP_SCOPE_ONELEVEL;
- else if (strcasecmp(str, "subtree") == 0)
- *scope_r = LDAP_SCOPE_SUBTREE;
- else
- return -1;
- return 0;
-}
-
static bool ldap_setting_check(void *_set, pool_t pool ATTR_UNUSED,
const char **error_r)
{
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/lib-test \
-I$(top_srcdir)/src/lib-dns \
+ -I$(top_srcdir)/src/lib-ldap \
-I$(top_srcdir)/src/lib-mail \
-I$(top_srcdir)/src/lib-http \
-I$(top_srcdir)/src/lib-settings \
noinst_HEADERS = \
ldap-connection-pool.h \
- ldap-private.h
+ ldap-private.h \
+ ldap-settings-parse.h
pkginc_libdir=$(pkgincludedir)
pkginc_lib_HEADERS = $(headers)
--- /dev/null
+#ifndef LDAP_SETTINGS_PARSE_H
+#define LDAP_SETTINGS_PARSE_H
+
+#include <ldap.h>
+
+static inline int ldap_parse_scope(const char *str, int *scope_r)
+{
+ if (strcasecmp(str, "base") == 0)
+ *scope_r = LDAP_SCOPE_BASE;
+ else if (strcasecmp(str, "onelevel") == 0)
+ *scope_r = LDAP_SCOPE_ONELEVEL;
+ else if (strcasecmp(str, "subtree") == 0)
+ *scope_r = LDAP_SCOPE_SUBTREE;
+ else
+ return -1;
+ return 0;
+}
+
+#endif