/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright 2026 Thorsten Töpper * * vim:ts=4:sw=4:expandtab */ #ifndef DATABASE_INTERACTION_H #define DATABASE_INTERACTION_H #include "file_processor.h" /*=========== FUNCTIONS ===========*/ bool dbi_open(char *filename); void dbi_close(); char *dbi_select_filename_by_id(int64_t id); int64_t dbi_select_filename_by_name(const char *name); int64_t *dbi_select_filenames_all_ids(); int dbi_insert_filename(const char *filename); char *dbi_select_path_by_id(int64_t id); int64_t dbi_select_path_by_pathname(const char *pathname); int dbi_insert_pathname(const char *path); struct df_hashstrings *dbi_select_hashes_by_id(int64_t id); int64_t *dbi_select_hashes_all_ids(); int64_t dbi_select_hashes_by_strings(const char *blake2, const char *sha256, const char *sha512); int dbi_insert_hashes(const char *blake2, const char *sha256, const char *sha512); int64_t dbi_select_fileinfo_by_hash_path_filename_ids(int64_t hash_id, int64_t path_id, int64_t filename_id); int64_t dbi_select_fileinfo_by_path_filename_ids(int64_t pname_id, int64_t fname_id); int dbi_insert_fileinfo(struct df_fileinfo *fi); int dbi_update_fileinfo_last_seen(int64_t id); int dbi_update_fileinfo_complete(struct df_fileinfo *fi, int64_t existing_id); int dbi_print_fileinfo_resolved(FILE *fd); int dbi_print_identical_hashes(FILE *fd); int dbi_print_identical_filenames(FILE *fd); int64_t *dbi_select_hashes_all_ids(); #endif