2011-05-19 06:32:09 +02:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
2012-05-20 16:41:18 +02:00
|
|
|
**
|
2019-07-12 16:36:08 +02:00
|
|
|
** Copyright (C) 2012-2019 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
2010-11-14 12:55:04 +01:00
|
|
|
**
|
|
|
|
** 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_RUNTIME_H__
|
|
|
|
#define __MU_RUNTIME_H__
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-11-20 19:29:11 +01:00
|
|
|
/**
|
|
|
|
* initialize the mu runtime system; initializes logging and other
|
|
|
|
* systems. To uninitialize, use mu_runtime_uninit
|
2012-05-20 16:41:18 +02:00
|
|
|
*
|
2020-04-19 13:02:48 +02:00
|
|
|
* @param muhome path where to find the mu home directory (typically, ~/.cache/mu)
|
2011-07-23 16:56:25 +02:00
|
|
|
* @param name of the main program, ie. 'mu', 'mug' or
|
|
|
|
* 'procmule'. this influences the name of the e.g. the logfile
|
2020-05-30 12:24:53 +02:00
|
|
|
* @param debug debug-mode
|
2012-05-20 16:41:18 +02:00
|
|
|
*
|
2010-11-20 19:29:11 +01:00
|
|
|
* @return TRUE if succeeded, FALSE in case of error
|
|
|
|
*/
|
2021-10-20 11:18:15 +02:00
|
|
|
gboolean mu_runtime_init(const char* muhome, const char* name, gboolean debug);
|
2010-11-20 19:29:11 +01:00
|
|
|
|
|
|
|
/**
|
2012-05-20 16:41:18 +02:00
|
|
|
* free all resources
|
|
|
|
*
|
2010-11-20 19:29:11 +01:00
|
|
|
*/
|
2021-10-20 11:18:15 +02:00
|
|
|
void mu_runtime_uninit(void);
|
2011-03-19 09:07:32 +01:00
|
|
|
|
2019-07-12 16:36:08 +02:00
|
|
|
typedef enum {
|
2021-10-20 11:18:15 +02:00
|
|
|
MU_RUNTIME_PATH_XAPIANDB, /* mu xapian db path */
|
|
|
|
MU_RUNTIME_PATH_BOOKMARKS, /* mu bookmarks file path */
|
|
|
|
MU_RUNTIME_PATH_CACHE, /* mu cache path */
|
|
|
|
MU_RUNTIME_PATH_MIMECACHE, /* mu cache path for attachments etc. */
|
|
|
|
MU_RUNTIME_PATH_LOGDIR, /* mu path for log files */
|
2011-03-19 09:07:32 +01:00
|
|
|
|
|
|
|
MU_RUNTIME_PATH_NUM
|
2019-07-12 16:36:08 +02:00
|
|
|
} MuRuntimePath;
|
2011-03-19 09:07:32 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get a file system path to some 'special' file or directory
|
2012-05-20 16:41:18 +02:00
|
|
|
*
|
2011-03-19 09:07:32 +01:00
|
|
|
* @return ma string which should be not be modified/freed, or NULL in
|
|
|
|
* case of error.
|
|
|
|
*/
|
2021-10-20 11:18:15 +02:00
|
|
|
const char* mu_runtime_path(MuRuntimePath path);
|
2011-03-19 09:07:32 +01:00
|
|
|
|
2010-11-14 12:55:04 +01:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /*__MU_RUNTIME_H__*/
|