diff --git a/src/database.c b/src/database.c index d13cc2d..452ee7c 100644 --- a/src/database.c +++ b/src/database.c @@ -192,7 +192,7 @@ int imdb_write_list(imdb_t *db, imdb_rec_t *list, size_t list_len) return processed; } -int imdb_search(imdb_t *db, imdb_rec_t *sample, float tresh, match_t **matches) +int imdb_search(imdb_t *db, imdb_rec_t *sample, float tresh, imdb_match_t **matches) { const int blk_size = 4096; uint64_t found = 0; @@ -233,13 +233,13 @@ int imdb_search(imdb_t *db, imdb_rec_t *sample, float tresh, match_t **matches) /* allocate more memory, if needed */ if (found % 10 == 0) { - *matches = realloc(*matches, (found + 10) * sizeof(match_t)); + *matches = realloc(*matches, (found + 10) * sizeof(imdb_match_t)); if (*matches == NULL) { db->errstr = "Memory allocation error"; FREE(blk.data); return -1; } - memset(&(*matches)[found], 0x0, sizeof(match_t) * 10); + memset(&(*matches)[found], 0x0, sizeof(imdb_match_t) * 10); } /* create match record */ diff --git a/src/database.h b/src/database.h index 2bccd49..3011356 100644 --- a/src/database.h +++ b/src/database.h @@ -66,7 +66,7 @@ typedef struct { typedef struct { uint64_t num; float diff; -} match_t; +} imdb_match_t; extern int imdb_open (imdb_t *db, const char *path); extern int imdb_close(imdb_t *db); @@ -86,6 +86,6 @@ extern int imdb_write_list(imdb_t *db, imdb_rec_t *list, size_t list_len); 0 if nothing found >0 if found some matches */ -extern int imdb_search(imdb_t *db, imdb_rec_t *sample, float tresh, match_t **matches); +extern int imdb_search(imdb_t *db, imdb_rec_t *sample, float tresh, imdb_match_t **matches); #endif diff --git a/src/util.c b/src/util.c index fce197f..59e31a7 100644 --- a/src/util.c +++ b/src/util.c @@ -43,7 +43,7 @@ void usage(int exitcode) { int search_similar(imdb_t *db, imdb_rec_t *sample, float tresh) { int ret = 0, i = 0; - match_t *matches = NULL; + imdb_match_t *matches = NULL; ret = imdb_search(db, sample, tresh, &matches); if (ret == -1) {