use c++ for some more sources
Do a (superficial) port to c++ of some of the c sources. Update deps. Fix a few compiler warnings.
This commit is contained in:
@ -59,17 +59,36 @@ noinst_LTLIBRARIES= \
|
||||
libmu.la
|
||||
|
||||
libmu_la_SOURCES= \
|
||||
mu-bookmarks.c \
|
||||
mu-bookmarks.h \
|
||||
mu-bookmarks.cc \
|
||||
mu-bookmarks.hh \
|
||||
mu-contacts.cc \
|
||||
mu-contacts.hh \
|
||||
mu-container.cc \
|
||||
mu-container.hh \
|
||||
mu-data.hh \
|
||||
mu-parser.cc \
|
||||
mu-parser.hh \
|
||||
mu-query.cc \
|
||||
mu-query.hh \
|
||||
mu-runtime.cc \
|
||||
mu-runtime.hh \
|
||||
mu-script.cc \
|
||||
mu-script.hh \
|
||||
mu-server.cc \
|
||||
mu-server.hh \
|
||||
mu-store.cc \
|
||||
mu-store.hh \
|
||||
mu-threader.cc \
|
||||
mu-threader.hh \
|
||||
mu-tokenizer.cc \
|
||||
mu-tokenizer.hh \
|
||||
mu-tree.hh \
|
||||
mu-xapian.cc \
|
||||
mu-xapian.hh \
|
||||
mu-flags.c \
|
||||
mu-flags.h \
|
||||
mu-maildir.c \
|
||||
mu-maildir.h \
|
||||
mu-flags.h \
|
||||
mu-msg-crypto.c \
|
||||
mu-msg-doc.cc \
|
||||
mu-msg-doc.h \
|
||||
@ -86,27 +105,7 @@ libmu_la_SOURCES= \
|
||||
mu-msg-priv.h \
|
||||
mu-msg-sexp.cc \
|
||||
mu-msg.c \
|
||||
mu-msg.h \
|
||||
mu-msg.h \
|
||||
mu-parser.cc \
|
||||
mu-parser.hh \
|
||||
mu-query.cc \
|
||||
mu-query.hh \
|
||||
mu-runtime.cc \
|
||||
mu-runtime.h \
|
||||
mu-script.c \
|
||||
mu-script.h \
|
||||
mu-server.cc \
|
||||
mu-server.hh \
|
||||
mu-store.cc \
|
||||
mu-store.hh \
|
||||
mu-threader.cc \
|
||||
mu-threader.hh \
|
||||
mu-tokenizer.cc \
|
||||
mu-tokenizer.hh \
|
||||
mu-tree.hh \
|
||||
mu-xapian.cc \
|
||||
mu-xapian.hh
|
||||
mu-msg.h
|
||||
|
||||
libmu_la_LIBADD= \
|
||||
$(XAPIAN_LIBS) \
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||
/*
|
||||
** Copyright (C) 2010-2013 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
** Copyright (C) 2010-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
|
||||
@ -19,11 +18,11 @@
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include "mu-bookmarks.h"
|
||||
#include "mu-bookmarks.hh"
|
||||
|
||||
#define MU_BOOKMARK_GROUP "mu"
|
||||
|
||||
struct _MuBookmarks {
|
||||
struct MuBookmarks {
|
||||
char *_bmpath;
|
||||
GHashTable *_hash;
|
||||
};
|
||||
@ -113,7 +112,7 @@ mu_bookmarks_lookup (MuBookmarks *bm, const gchar *name)
|
||||
g_return_val_if_fail (bm, NULL);
|
||||
g_return_val_if_fail (name, NULL);
|
||||
|
||||
return g_hash_table_lookup (bm->_hash, name);
|
||||
return (const char*)g_hash_table_lookup (bm->_hash, name);
|
||||
}
|
||||
|
||||
struct _BMData {
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2008-2013 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
** Copyright (C) 2008-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
|
||||
@ -17,23 +17,20 @@
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef __MU_BOOKMARKS_H__
|
||||
#define __MU_BOOKMARKS_H__
|
||||
#ifndef MU_BOOKMARKS_HH__
|
||||
#define MU_BOOKMARKS_HH__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
/**
|
||||
* @addtogroup MuBookmarks
|
||||
* Functions for dealing with bookmarks
|
||||
* @{
|
||||
*/
|
||||
|
||||
struct _MuBookmarks;
|
||||
/*! \struct MuBookmarks
|
||||
* \brief Opaque structure representing a sequence of bookmarks
|
||||
*/
|
||||
typedef struct _MuBookmarks MuBookmarks;
|
||||
struct MuBookmarks;
|
||||
|
||||
|
||||
/**
|
||||
@ -81,6 +78,4 @@ void mu_bookmarks_foreach (MuBookmarks *bm, MuBookmarksForeachFunc func,
|
||||
|
||||
/** @} */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /*__MU_BOOKMARKS_H__*/
|
||||
@ -1,6 +1,5 @@
|
||||
/* -*- mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||
**
|
||||
** Copyright (C) 2012-2013 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
/*
|
||||
** 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2019 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
** Copyright (C) 2019-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
|
||||
@ -17,7 +17,7 @@
|
||||
**
|
||||
*/
|
||||
|
||||
#include "mu-runtime.h"
|
||||
#include "mu-runtime.hh"
|
||||
#include "utils/mu-util.h"
|
||||
#include "utils/mu-logger.hh"
|
||||
|
||||
|
||||
@ -17,9 +17,7 @@
|
||||
**
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif /*HAVE_CONFIG_H*/
|
||||
|
||||
#ifdef BUILD_GUILE
|
||||
|
||||
@ -37,14 +35,14 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "utils/mu-str.h"
|
||||
#include "mu-script.h"
|
||||
#include "mu-script.hh"
|
||||
#include "utils/mu-util.h"
|
||||
|
||||
/**
|
||||
* Structure with information about a certain script.
|
||||
* the values will be *freed* when MuScriptInfo is freed
|
||||
*/
|
||||
struct _MuScriptInfo {
|
||||
struct MuScriptInfo {
|
||||
char *_name; /* filename-sans-extension */
|
||||
char *_path; /* full path to script */
|
||||
char *_oneline; /* one-line description */
|
||||
@ -121,15 +119,17 @@ mu_script_info_matches_regex (MuScriptInfo *msi, const char *rxstr,
|
||||
g_return_val_if_fail (msi, FALSE);
|
||||
g_return_val_if_fail (rxstr, FALSE);
|
||||
|
||||
rx = g_regex_new (rxstr, G_REGEX_CASELESS|G_REGEX_OPTIMIZE, 0, err);
|
||||
rx = g_regex_new (rxstr,
|
||||
(GRegexCompileFlags)(G_REGEX_CASELESS|G_REGEX_OPTIMIZE),
|
||||
(GRegexMatchFlags)0, err);
|
||||
if (!rx)
|
||||
return FALSE;
|
||||
|
||||
match = FALSE;
|
||||
if (msi->_name)
|
||||
match = g_regex_match (rx, msi->_name, 0, NULL);
|
||||
match = g_regex_match (rx, msi->_name, (GRegexMatchFlags)0, NULL);
|
||||
if (!match && msi->_oneline)
|
||||
match = g_regex_match (rx, msi->_oneline, 0, NULL);
|
||||
match = g_regex_match (rx, msi->_oneline,(GRegexMatchFlags)0, NULL);
|
||||
|
||||
return match;
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2012-2013 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
** 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
|
||||
@ -17,16 +17,13 @@
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef __MU_SCRIPT_H__
|
||||
#define __MU_SCRIPT_H__
|
||||
#ifndef MU_SCRIPT_HH__
|
||||
#define MU_SCRIPT_HH__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Opaque structure with information about a script */
|
||||
struct _MuScriptInfo;
|
||||
typedef struct _MuScriptInfo MuScriptInfo;
|
||||
struct MuScriptInfo;
|
||||
|
||||
/**
|
||||
* get the name of the script (sans-extension, if some extension was
|
||||
@ -127,6 +124,4 @@ MuScriptInfo* mu_script_find_script_with_name (GSList *lst, const char *name);
|
||||
gboolean mu_script_guile_run (MuScriptInfo *msi, const char *muhome,
|
||||
const char **args, GError **err);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /*__MU_SCRIPT_H__*/
|
||||
#endif /*MU_SCRIPT_HH__*/
|
||||
@ -35,7 +35,7 @@
|
||||
#include <glib/gprintf.h>
|
||||
|
||||
#include "mu-msg.h"
|
||||
#include "mu-runtime.h"
|
||||
#include "mu-runtime.hh"
|
||||
#include "mu-maildir.h"
|
||||
#include "mu-query.hh"
|
||||
#include "index/mu-indexer.hh"
|
||||
|
||||
Reference in New Issue
Block a user