From 0dd884f3b8ff6464e4b0558b08d665c0159b5e05 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 3 Jan 2010 13:41:32 +0200 Subject: [PATCH] * WIP: mu_index_cleanup --- src/mu-index.c | 14 ++++---------- src/mu-index.h | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/mu-index.c b/src/mu-index.c index b14e8197..cc09bc81 100644 --- a/src/mu-index.c +++ b/src/mu-index.c @@ -282,16 +282,10 @@ mu_index_stats (MuIndex *index, const char* path, } -MuResult -mu_index_cleanup (MuIndex *index, MuIndexStats *stats, - MuIndexMsgCallback msg_cb, - MuIndexDirCallback dir_cb, void *user_data) +MuResult mu_index_cleanup (MuIndex *index, MuIndexStats *result, + MuIndexCleanupDeleteCallback cb, + void *user_data) { - if (stats) - memset (stats, 0, sizeof(MuIndexStats)); - - /* FIXME: implement this */ return MU_OK; + } - - diff --git a/src/mu-index.h b/src/mu-index.h index e76f5b81..89307d8c 100644 --- a/src/mu-index.h +++ b/src/mu-index.h @@ -124,7 +124,18 @@ MuResult mu_index_stats (MuIndex *index, const char* path, MuIndexStats *result, MuIndexMsgCallback msg_cb, MuIndexDirCallback dir_cb, void *user_data); -typedef MuResult (*MuIndexCleanupCallback) (MuIndexStats*, void *user_data); + + +/** + * callback function to determine if a message should be delete from + * the database; if it returs MU_OK it will be delete, if returns + * MU_IGNORE, the message will be ignored. In other cases, stop the callback + * + * @param MuIndexCleanupCallback + * + * @return + */ +typedef MuResult (*MuIndexCleanupDeleteCallback) (MuIndexStats*, void *user_data); /** * cleanup the database; ie. remove entries for which no longer a corresponding @@ -140,7 +151,7 @@ typedef MuResult (*MuIndexCleanupCallback) (MuIndexStats*, void *user_data); * case of some error. */ MuResult mu_index_cleanup (MuIndex *index, MuIndexStats *result, - MuIndexMsgCallback msg_cb, MuIndexDirCallback dir_cb, + MuIndexCleanupDeleteCallback cb, void *user_data); #endif /*__MU_INDEX_H__*/