Olaf
Overly Lightweight Acoustic Fingerprinting
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
olaf_fp_db_writer_cache.h File Reference

Reads fingerprints from a csv file and stores them in a database. More...

#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "olaf_db.h"
#include "olaf_config.h"

Go to the source code of this file.

Macros

#define MAX_LINE_LEN   2048
 
#define MAX_TOKEN_LEN   512
 
#define FP_ARRAY_SIZE   10000
 

Typedefs

typedef struct Olaf_FP_DB_Writer_Cache Olaf_FP_DB_Writer_Cache
 

Functions

Olaf_FP_DB_Writer_Cacheolaf_fp_db_writer_cache_new (Olaf_DB *db, Olaf_Config *config, const char *csv_filename)
 Initializes a new cache db writer.
 
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.
 
void olaf_fp_db_writer_cache_destroy (Olaf_FP_DB_Writer_Cache *olaf_fp_db_writer_cache)
 Free resources and close the CSV file.
 

Detailed Description

Reads fingerprints from a csv file and stores them in a database.

Function Documentation

◆ olaf_fp_db_writer_cache_destroy()

void olaf_fp_db_writer_cache_destroy ( Olaf_FP_DB_Writer_Cache olaf_fp_db_writer_cache)

Free resources and close the CSV file.

Parameters
olaf_fp_db_writer_cacheThe olaf fp database writer cache

◆ olaf_fp_db_writer_cache_new()

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.

Parameters
dbThe database.
configThe configuration.
[in]csv_filenameThe csv filename to parse and store.
Returns
Newly initialized state information.

◆ olaf_fp_db_writer_cache_store()

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.

Parameters
olaf_fp_db_writer_cacheThe olaf fp database writer cache