summaryrefslogtreecommitdiff
path: root/src/core/storage_private.h
diff options
context:
space:
mode:
authorinfo@mode42.com <info@mode42.com>2026-08-08 03:54:55 +0000
committerinfo@mode42.com <info@mode42.com>2026-08-08 03:54:55 +0000
commit20cb29c2f8c5c87bc590896854a20b1473ceb358 (patch)
tree2857f41513a56ad41af97b57362639298aa7f033 /src/core/storage_private.h
#2
Diffstat (limited to 'src/core/storage_private.h')
-rw-r--r--src/core/storage_private.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/core/storage_private.h b/src/core/storage_private.h
new file mode 100644
index 0000000..579250c
--- /dev/null
+++ b/src/core/storage_private.h
@@ -0,0 +1,81 @@
+#ifndef HYBBX_STORAGE_PRIVATE_H
+#define HYBBX_STORAGE_PRIVATE_H
+
+#include "hybbx/auth.h"
+#include "hybbx/storage.h"
+
+#include <stddef.h>
+
+struct hybbx_storage {
+ hybbx_storage_backend_kind_t backend;
+ char *path;
+ char guest_prefix[HYBBX_AUTH_GUEST_PREFIX_MAX];
+ hybbx_storage_sql_config_t sql_cfg;
+ void *backend_data;
+};
+
+hybbx_result_t hybbx_storage_flatfile_open(hybbx_storage_t *storage);
+void hybbx_storage_flatfile_close(hybbx_storage_t *storage);
+hybbx_result_t hybbx_storage_flatfile_session_begin(hybbx_storage_t *storage,
+ const hybbx_user_record_t *user,
+ const char *transport,
+ hybbx_session_record_t *out);
+hybbx_result_t hybbx_storage_flatfile_session_end(hybbx_storage_t *storage,
+ uint64_t session_id);
+hybbx_result_t hybbx_storage_flatfile_find_user(hybbx_storage_t *storage,
+ const char *username,
+ hybbx_user_record_t *out);
+hybbx_result_t hybbx_storage_flatfile_resolve_user(hybbx_storage_t *storage,
+ const char *name,
+ hybbx_user_record_t *out);
+hybbx_result_t hybbx_storage_flatfile_count_level(hybbx_storage_t *storage,
+ hybbx_user_level_t level,
+ size_t *count);
+hybbx_result_t hybbx_storage_flatfile_foreach_user(
+ hybbx_storage_t *storage,
+ hybbx_storage_user_fn fn,
+ void *ctx);
+hybbx_result_t hybbx_storage_flatfile_register_user(hybbx_storage_t *storage,
+ const hybbx_user_registration_t *reg,
+ hybbx_user_record_t *out);
+hybbx_result_t hybbx_storage_flatfile_update_user(hybbx_storage_t *storage,
+ const hybbx_user_record_t *user);
+hybbx_result_t hybbx_storage_flatfile_delete_user(hybbx_storage_t *storage,
+ uint64_t user_id);
+
+hybbx_result_t hybbx_storage_sql_open(hybbx_storage_t *storage);
+void hybbx_storage_sql_close(hybbx_storage_t *storage);
+hybbx_result_t hybbx_storage_sql_register_user(hybbx_storage_t *storage,
+ const hybbx_user_registration_t *reg,
+ hybbx_user_record_t *out);
+hybbx_result_t hybbx_storage_sql_find_user(hybbx_storage_t *storage,
+ const char *username,
+ hybbx_user_record_t *out);
+hybbx_result_t hybbx_storage_sql_resolve_user(hybbx_storage_t *storage,
+ const char *name,
+ hybbx_user_record_t *out);
+hybbx_result_t hybbx_storage_sql_count_level(hybbx_storage_t *storage,
+ hybbx_user_level_t level,
+ size_t *count);
+hybbx_result_t hybbx_storage_sql_foreach_user(hybbx_storage_t *storage,
+ hybbx_storage_user_fn fn,
+ void *ctx);
+hybbx_result_t hybbx_storage_sql_update_user(hybbx_storage_t *storage,
+ const hybbx_user_record_t *user);
+hybbx_result_t hybbx_storage_sql_delete_user(hybbx_storage_t *storage,
+ uint64_t user_id);
+hybbx_result_t hybbx_storage_sql_session_begin(hybbx_storage_t *storage,
+ const hybbx_user_record_t *user,
+ const char *transport,
+ hybbx_session_record_t *out);
+hybbx_result_t hybbx_storage_sql_session_end(hybbx_storage_t *storage,
+ uint64_t session_id);
+void hybbx_storage_sql_backup_files(const hybbx_storage_t *storage);
+void hybbx_storage_sql_backup_tick(hybbx_storage_t *storage);
+
+#ifdef HYBBX_HAVE_SQLITE
+struct sqlite3;
+struct sqlite3 *hybbx_storage_sql_mail_db(hybbx_storage_t *storage);
+#endif
+
+#endif /* HYBBX_STORAGE_PRIVATE_H */
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com