diff --git a/lib/mu-contacts.h b/lib/mu-contacts.h deleted file mode 100644 index 62a946eb..00000000 --- a/lib/mu-contacts.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -** Copyright (C) 2012-2016 Dirk-Jan C. Binnema -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 3, or (at your option) any -** later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software Foundation, -** Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -** -*/ - -#ifndef __MU_CONTACTS_H__ -#define __MU_CONTACTS_H__ - -#include -#include - -G_BEGIN_DECLS - -struct _MuContacts; -typedef struct _MuContacts MuContacts; - - -/** - * return the number of contacts - * - * @param self a contacts object - * - * @return the number of contacts - */ -size_t mu_contacts_count (MuContacts *self); - -/** - * Function called for mu_contacts_foreach; returns the e-mail address, name - * (which may be NULL) , whether the message is 'personal', the timestamp for - * the address (when it was last seen), and the frequency (in how many message - * did this contact participate) and the tstamp (last modification) - * - */ -typedef void (*MuContactsForeachFunc) (const char *full_address, - const char *email, const char *name, - gboolean personal, - time_t last_seen, unsigned freq, - gint64 tstamp, gpointer user_data); - -/** - * call a function for either each contact, or each contact satisfying - * a regular expression, - * - * @param self contacts object - * @param func callback function to be called for each - * @param user_data user data to pass to the callback - * - * @return TRUE if the function succeeded, or FALSE if the provide regular - * expression was invalid (and not NULL) - */ -gboolean mu_contacts_foreach (MuContacts *self, - MuContactsForeachFunc func, - gpointer user_data); - -G_END_DECLS - -#endif /*__MU_CONTACTS_H__*/ diff --git a/lib/mu-contacts.hh b/lib/mu-contacts.hh index 134ee05c..2ab33ff9 100644 --- a/lib/mu-contacts.hh +++ b/lib/mu-contacts.hh @@ -20,6 +20,14 @@ #ifndef __MU_CONTACTS_HH__ #define __MU_CONTACTS_HH__ +#include +#include + +struct _MuContacts; +typedef struct _MuContacts MuContacts; + +#ifdef __cplusplus + #include #include #include @@ -27,9 +35,6 @@ #include #include - -#include "mu-contacts.h" - namespace Mu { /// Data-structure representing information about some contact. @@ -151,6 +156,50 @@ private: std::unique_ptr priv_; }; -}; // namespace Mu +} // namespace Mu + +#endif /*__cplusplus*/ + +G_BEGIN_DECLS + + +/** + * return the number of contacts + * + * @param self a contacts object + * + * @return the number of contacts + */ +size_t mu_contacts_count (MuContacts *self); + +/** + * Function called for mu_contacts_foreach; returns the e-mail address, name + * (which may be NULL) , whether the message is 'personal', the timestamp for + * the address (when it was last seen), and the frequency (in how many message + * did this contact participate) and the tstamp (last modification) + * + */ +typedef void (*MuContactsForeachFunc) (const char *full_address, + const char *email, const char *name, + gboolean personal, + time_t last_seen, unsigned freq, + gint64 tstamp, gpointer user_data); + +/** + * call a function for either each contact, or each contact satisfying + * a regular expression, + * + * @param self contacts object + * @param func callback function to be called for each + * @param user_data user data to pass to the callback + * + * @return TRUE if the function succeeded, or FALSE if the provide regular + * expression was invalid (and not NULL) + */ +gboolean mu_contacts_foreach (MuContacts *self, + MuContactsForeachFunc func, + gpointer user_data); + +G_END_DECLS #endif /* __MU_CONTACTS_HH__ */ diff --git a/lib/mu-store-read.cc b/lib/mu-store-read.cc index a663cd61..1668a165 100644 --- a/lib/mu-store-read.cc +++ b/lib/mu-store-read.cc @@ -40,7 +40,7 @@ #include "mu-str.h" #include "mu-date.h" #include "mu-flags.h" -#include "mu-contacts.h" +#include "mu-contacts.hh" // note: not re-entrant diff --git a/lib/mu-store.cc b/lib/mu-store.cc index 0bcbe765..ea78395f 100644 --- a/lib/mu-store.cc +++ b/lib/mu-store.cc @@ -40,7 +40,7 @@ #include "mu-str.h" #include "mu-date.h" #include "mu-flags.h" -#include "mu-contacts.h" +#include "mu-contacts.hh" diff --git a/lib/mu-store.h b/lib/mu-store.h index 4f83998f..2a512ff7 100644 --- a/lib/mu-store.h +++ b/lib/mu-store.h @@ -24,7 +24,7 @@ #include #include #include /* for MuError, MuError */ -#include +#include G_BEGIN_DECLS diff --git a/mu/mu-cmd-cfind.c b/mu/mu-cmd-cfind.c index 4bc2524d..44de4930 100644 --- a/mu/mu-cmd-cfind.c +++ b/mu/mu-cmd-cfind.c @@ -27,7 +27,7 @@ #include "mu-util.h" #include "mu-str.h" #include "mu-date.h" -#include "mu-contacts.h" +#include "mu-contacts.hh" #include "mu-runtime.h" /** diff --git a/mu/mu-cmd-server.c b/mu/mu-cmd-server.c index 36a1b7f8..9526d07d 100644 --- a/mu/mu-cmd-server.c +++ b/mu/mu-cmd-server.c @@ -51,7 +51,7 @@ #include "mu-index.h" #include "mu-store.h" #include "mu-msg-part.h" -#include "mu-contacts.h" +#include "mu-contacts.hh" /* signal handling *****************************************************/ /* diff --git a/mu/mu-cmd.c b/mu/mu-cmd.c index 55841315..350b9266 100644 --- a/mu/mu-cmd.c +++ b/mu/mu-cmd.c @@ -35,7 +35,7 @@ #include "mu-str.h" #include "mu-date.h" #include "mu-maildir.h" -#include "mu-contacts.h" +#include "mu-contacts.hh" #include "mu-runtime.h" #include "mu-flags.h" #include "mu-store.h" @@ -583,7 +583,6 @@ with_store (store_func func, MuConfig *opts, gboolean read_only, else store = mu_store_new_writable (mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB), - mu_runtime_path(MU_RUNTIME_PATH_CONTACTS), opts->rebuild, err); if (!store) return MU_G_ERROR_CODE(err);