Olaf
Overly Lightweight Acoustic Fingerprinting
Loading...
Searching...
No Matches
olaf_fp_db_writer_cache.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
17
25#ifndef OLAF_FP_DB_WRITER_CACHE_H
26#define OLAF_FP_DB_WRITER_CACHE_H
27 #include <stdint.h>
28 #include <stdlib.h>
29 #include <string.h>
30
31 #include "olaf_db.h"
32 #include "olaf_config.h"
33
34 #define MAX_LINE_LEN 2048
35 #define MAX_TOKEN_LEN 512
36 #define FP_ARRAY_SIZE 10000
37
44
54 Olaf_FP_DB_Writer_Cache * olaf_fp_db_writer_cache_new(Olaf_DB* db,Olaf_Config * config,const char *csv_filename);
55
61 void olaf_fp_db_writer_cache_store( Olaf_FP_DB_Writer_Cache * olaf_fp_db_writer_cache);
62
68 void olaf_fp_db_writer_cache_destroy(Olaf_FP_DB_Writer_Cache * olaf_fp_db_writer_cache);
69
70#endif //OLAF_FP_DB_WRITER_H
71
72
Olaf configuration pramameters.
Olaf fingerprint database.
void olaf_fp_db_writer_cache_store(Olaf_FP_DB_Writer_Cache *olaf_fp_db_writer_cache)
Read the csv file and store the fingerpints within the file. Or an error if the CSV is malformed.
Definition: olaf_fp_db_writer_cache.c:133
void olaf_fp_db_writer_cache_destroy(Olaf_FP_DB_Writer_Cache *olaf_fp_db_writer_cache)
Free resources and close the CSV file.
Definition: olaf_fp_db_writer_cache.c:153
Olaf_FP_DB_Writer_Cache * olaf_fp_db_writer_cache_new(Olaf_DB *db, Olaf_Config *config, const char *csv_filename)
Initializes a new cache db writer.
Definition: olaf_fp_db_writer_cache.c:116
Configuration parameters defining the behaviour of Olaf.
Definition: olaf_config.h:48
A struct with state information on the data store.
Definition: olaf_db.c:27
An opaque struct with state information related to the cache writer.
Definition: olaf_fp_db_writer_cache.c:26