Olaf
Overly Lightweight Acoustic Fingerprinting
Loading...
Searching...
No Matches
olaf_db.h
Go to the documentation of this file.
1// Olaf: Overly Lightweight Acoustic Fingerprinting
2// Copyright (C) 2019-2025 Joren Six
3
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Affero General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Affero General Public License for more details.
13
14// You should have received a copy of the GNU Affero General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
35
36#ifndef OLAF_DB_H
37#define OLAF_DB_H
38 #include <stdbool.h>
39 #include <stdint.h>
40
41 #include "olaf_resource_meta_data.h"
42
55 typedef struct Olaf_DB Olaf_DB;
56
62 Olaf_DB * olaf_db_new(const char * db_file_folder,bool readonly);
63
68 void olaf_db_destroy(Olaf_DB * db);
69
70
77 void olaf_db_store_meta_data(Olaf_DB * db, uint32_t * key, Olaf_Resource_Meta_data * value);
78
85 void olaf_db_find_meta_data(Olaf_DB * db , uint32_t * key, Olaf_Resource_Meta_data * value);
86
92 void olaf_db_delete_meta_data(Olaf_DB * db , uint32_t * key);
93
100 bool olaf_db_has_meta_data(Olaf_DB * db , uint32_t * key);
101
102
108 void olaf_db_stats_meta_data(Olaf_DB * db,bool verbose);
109
110
111 //####Finger print methods
112
120 void olaf_db_store(Olaf_DB * db, uint64_t * keys, uint64_t * values, size_t size);
121
129 void olaf_db_delete(Olaf_DB * db, uint64_t * keys, uint64_t * values, size_t size);
130
140 size_t olaf_db_find(Olaf_DB * db,uint64_t start_key,uint64_t stop_key,uint64_t * results, size_t results_size);
141
142
150 bool olaf_db_find_single(Olaf_DB * db,uint64_t start_key,uint64_t stop_key);
151
157 void olaf_db_stats(Olaf_DB * db,bool verbose);
158
165 uint32_t olaf_db_string_hash(const char *key, size_t len);
166
167#endif // OLAF_DB_H
void olaf_db_delete(Olaf_DB *db, uint64_t *keys, uint64_t *values, size_t size)
Definition olaf_db.c:261
void olaf_db_stats_meta_data(Olaf_DB *db, bool verbose)
Definition olaf_db.c:185
void olaf_db_stats(Olaf_DB *db, bool verbose)
Definition olaf_db.c:415
void olaf_db_delete_meta_data(Olaf_DB *db, uint32_t *key)
Definition olaf_db.c:145
void olaf_db_store(Olaf_DB *db, uint64_t *keys, uint64_t *values, size_t size)
Definition olaf_db.c:257
void olaf_db_destroy(Olaf_DB *db)
Definition olaf_db.c:439
void olaf_db_store_meta_data(Olaf_DB *db, uint32_t *key, Olaf_Resource_Meta_data *value)
Definition olaf_db.c:126
bool olaf_db_has_meta_data(Olaf_DB *db, uint32_t *key)
Definition olaf_db.c:243
size_t olaf_db_find(Olaf_DB *db, uint64_t start_key, uint64_t stop_key, uint64_t *results, size_t results_size)
Definition olaf_db.c:285
bool olaf_db_find_single(Olaf_DB *db, uint64_t start_key, uint64_t stop_key)
Definition olaf_db.c:280
void olaf_db_find_meta_data(Olaf_DB *db, uint32_t *key, Olaf_Resource_Meta_data *value)
Definition olaf_db.c:160
Olaf_DB * olaf_db_new(const char *db_file_folder, bool readonly)
Definition olaf_db.c:47
uint32_t olaf_db_string_hash(const char *key, size_t len)
Definition olaf_db.c:88
A struct with state information on the data store.
Definition olaf_db.c:27
A struct containing meta data on indexed audio files.
Definition olaf_resource_meta_data.h:48