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-2023 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
36#ifndef OLAF_DB_H
37#define OLAF_DB_H
38 #include <stdbool.h>
39 #include <stdint.h>
40
50 typedef struct Olaf_DB Olaf_DB;
51
57 Olaf_DB * olaf_db_new(const char * db_file_folder,bool readonly);
58
63 void olaf_db_destroy(Olaf_DB * db);
64
65
72
75 float duration;
79 char path[512];
80 };
81
88 void olaf_db_store_meta_data(Olaf_DB * db, uint32_t * key, Olaf_Resource_Meta_data * value);
89
96 void olaf_db_find_meta_data(Olaf_DB * db , uint32_t * key, Olaf_Resource_Meta_data * value);
97
103 void olaf_db_delete_meta_data(Olaf_DB * db , uint32_t * key);
104
111 bool olaf_db_has_meta_data(Olaf_DB * db , uint32_t * key);
112
113
119 void olaf_db_stats_meta_data(Olaf_DB * db,bool verbose);
120
121
122 //####Finger print methods
123
131 void olaf_db_store(Olaf_DB * db, uint64_t * keys, uint64_t * values, size_t size);
132
140 void olaf_db_delete(Olaf_DB * db, uint64_t * keys, uint64_t * values, size_t size);
141
151 size_t olaf_db_find(Olaf_DB * db,uint64_t start_key,uint64_t stop_key,uint64_t * results, size_t results_size);
152
153
161 bool olaf_db_find_single(Olaf_DB * db,uint64_t start_key,uint64_t stop_key);
162
168 void olaf_db_stats(Olaf_DB * db,bool verbose);
169
176 uint32_t olaf_db_string_hash(const char *key, size_t len);
177
178#endif // OLAF_DB_H
void olaf_db_delete(Olaf_DB *db, uint64_t *keys, uint64_t *values, size_t size)
Definition: olaf_db.c:259
void olaf_db_stats_meta_data(Olaf_DB *db, bool verbose)
Definition: olaf_db.c:183
void olaf_db_stats(Olaf_DB *db, bool verbose)
Definition: olaf_db.c:410
void olaf_db_delete_meta_data(Olaf_DB *db, uint32_t *key)
Definition: olaf_db.c:143
void olaf_db_store(Olaf_DB *db, uint64_t *keys, uint64_t *values, size_t size)
Definition: olaf_db.c:255
void olaf_db_destroy(Olaf_DB *db)
Definition: olaf_db.c:434
void olaf_db_store_meta_data(Olaf_DB *db, uint32_t *key, Olaf_Resource_Meta_data *value)
Definition: olaf_db.c:124
bool olaf_db_has_meta_data(Olaf_DB *db, uint32_t *key)
Definition: olaf_db.c:241
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:283
bool olaf_db_find_single(Olaf_DB *db, uint64_t start_key, uint64_t stop_key)
Definition: olaf_db.c:278
void olaf_db_find_meta_data(Olaf_DB *db, uint32_t *key, Olaf_Resource_Meta_data *value)
Definition: olaf_db.c:158
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:86
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_db.h:73
char path[512]
Definition: olaf_db.h:79
float duration
Definition: olaf_db.h:75
long fingerprints
Definition: olaf_db.h:77