lib: convert threader/container to c++

Did change the code much, but it's now compiled as c++
This commit is contained in:
Dirk-Jan C. Binnema
2020-11-04 20:00:30 +02:00
parent 7ce08d0486
commit c7a874b8d6
10 changed files with 46 additions and 55 deletions

49
lib/mu-threader.hh Normal file
View File

@ -0,0 +1,49 @@
/*
** Copyright (C) 2012-2020 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** 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_THREADER_HH__
#define MU_THREADER_HH__
#include <glib.h>
#include <mu-msg-iter.h>
/**
* takes an iter and the total number of matches, and from this
* generates a hash-table with information about the thread structure
* of these matches.
*
* the algorithm to find this structure is based on JWZ's
* message-threading algorithm, as descrbed in:
* http://www.jwz.org/doc/threading.html
*
* the returned hashtable maps the Xapian docid of iter (msg) to a ptr
* to a MuMsgIterThreadInfo structure (see mu-msg-iter.h)
*
* @param iter an iter; note this function will mu_msgi_iter_reset this iterator
* @param matches the number of matches in the set *
* @param sortfield the field to sort results by, or
* MU_MSG_FIELD_ID_NONE if no sorting should be performed
* @param revert if TRUE, if revert the sorting order
*
* @return a hashtable; free with g_hash_table_destroy when done with it
*/
GHashTable *mu_threader_calculate (MuMsgIter *iter, size_t matches,
MuMsgFieldId sortfield, gboolean revert);
#endif /*MU_THREADER_HH__*/