summaryrefslogtreecommitdiffstats
path: root/src/lib-storage/mail-storage-lua-private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib-storage/mail-storage-lua-private.h')
-rw-r--r--src/lib-storage/mail-storage-lua-private.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/lib-storage/mail-storage-lua-private.h b/src/lib-storage/mail-storage-lua-private.h
new file mode 100644
index 0000000..3ac169e
--- /dev/null
+++ b/src/lib-storage/mail-storage-lua-private.h
@@ -0,0 +1,31 @@
+#ifndef MAIL_STORAGE_LUA_PRIVATE_H
+#define MAIL_STORAGE_LUA_PRIVATE_H 1
+
+#define DLUA_MAILBOX_EQUALS(a, b) \
+ mailbox_equals((a), mailbox_get_namespace(b), mailbox_get_vname(b))
+
+struct lua_storage_keyvalue {
+ const char *key;
+ const char *value;
+ size_t value_len;
+};
+
+ARRAY_DEFINE_TYPE(lua_storage_keyvalue, struct lua_storage_keyvalue);
+
+void lua_storage_mail_register(struct dlua_script *script);
+void lua_storage_mail_user_register(struct dlua_script *script);
+void lua_storage_mailbox_register(struct dlua_script *script);
+
+int lua_storage_cmp(lua_State *L);
+
+int lua_storage_mailbox_attribute_get(struct mailbox *box, const char *key,
+ const char **value_r, size_t *value_len_r,
+ const char **error_r);
+int lua_storage_mailbox_attribute_set(struct mailbox *box, const char *key,
+ const char *value, size_t value_len,
+ const char **error_r);
+int lua_storage_mailbox_attribute_list(struct mailbox *box, const char *prefix,
+ ARRAY_TYPE(lua_storage_keyvalue) *items_r,
+ const char **error_r);
+
+#endif