From 56193e4decd61dada9947af597bc56d019300856 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 19 Mar 2015 16:02:32 +1000 Subject: [PATCH] * rename functions : db_{open,close} -> imdb_{open,close} --- src/database.c | 4 ++-- src/database.h | 4 ++-- src/util.c | 4 ++-- tests/database.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/database.c b/src/database.c index 7c8322a..7998804 100644 --- a/src/database.c +++ b/src/database.c @@ -44,7 +44,7 @@ const char *imdb_hdr_fmt = "IMDB v%02u, CAPS: %s;"; -int db_open(imdb_t *db, const char *path) +int imdb_open(imdb_t *db, const char *path) { int init = 0; ssize_t bytes = 0; @@ -82,7 +82,7 @@ int db_open(imdb_t *db, const char *path) return 0; } -int db_close(imdb_t *db) +int imdb_close(imdb_t *db) { assert(db != NULL); diff --git a/src/database.h b/src/database.h index 2c5da95..2cda218 100644 --- a/src/database.h +++ b/src/database.h @@ -67,8 +67,8 @@ typedef struct { float diff; } match_t; -extern int db_open(imdb_t *db, const char *path); -extern int db_close(imdb_t *db); +extern int imdb_open(imdb_t *db, const char *path); +extern int imdb_close(imdb_t *db); extern int db_rd_rec(imdb_t *db, imdb_rec_t *rec); extern int db_wr_rec(imdb_t *db, imdb_rec_t *rec); diff --git a/src/util.c b/src/util.c index 2cfb56a..1ab7034 100644 --- a/src/util.c +++ b/src/util.c @@ -238,7 +238,7 @@ int main(int argc, char **argv) if (mode == diff && (a <= 0 || b <= 0)) usage(EXIT_FAILURE); - if (db_open(&db, db_path) == -1) { + if (imdb_open(&db, db_path) == -1) { printf("%s\n", db.errstr); exit(EXIT_FAILURE); } @@ -255,7 +255,7 @@ int main(int argc, char **argv) if (mode == diff) rec_diff(&db, a, b, map); - db_close(&db); + imdb_close(&db); exit(EXIT_SUCCESS); } diff --git a/tests/database.c b/tests/database.c index 02c2561..7673412 100644 --- a/tests/database.c +++ b/tests/database.c @@ -9,7 +9,7 @@ int main(int argc, char **argv) char *path = "test.db"; unlink(path); - assert(db_open(&db, path) == 1); + assert(imdb_open(&db, path) == 1); rec[0].num = 1; assert(db_rd_rec(&db, rec) == 0); @@ -30,7 +30,7 @@ int main(int argc, char **argv) rec[1].num = 3; assert(db_rd_list(&db, rec, 2) == 1); - assert(db_close(&db) == 0); + assert(imdb_close(&db) == 0); return 0; }