2009-11-28 13:06:21 +01:00
|
|
|
/*
|
|
|
|
** Copyright (C) 2008, 2009 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_CONFIG_H__
|
|
|
|
#define __MU_CONFIG_H__
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include "mu-msg-fields.h"
|
|
|
|
|
|
|
|
/* struct with all configuration options for mu; it will be filled
|
|
|
|
* from the config file, and/or command line arguments */
|
|
|
|
|
|
|
|
struct _MuConfigOptions {
|
|
|
|
|
|
|
|
/* general options */
|
2009-11-29 23:04:16 +01:00
|
|
|
gboolean quiet; /* don't give any output */
|
|
|
|
gboolean debug; /* spew out debug info */
|
2009-11-28 19:55:50 +01:00
|
|
|
const char *muhome;/* the House of Mu */
|
|
|
|
gboolean version; /* request mu version */
|
|
|
|
gboolean log_stderr; /*log to stderr (instead of logfile)*/
|
|
|
|
gboolean log_append; /* append to log (instead of overwriting)*/
|
2009-12-11 21:04:54 +01:00
|
|
|
gchar** params; /* parameters (for querying) */
|
2009-11-28 13:06:21 +01:00
|
|
|
|
2009-11-29 23:04:16 +01:00
|
|
|
|
2009-11-28 13:06:21 +01:00
|
|
|
/* options for indexing */
|
2009-11-28 19:55:50 +01:00
|
|
|
const char *maildir; /* where the mails are */
|
|
|
|
gboolean cleanup; /* cleanup deleted mails form db */
|
|
|
|
gboolean reindex; /* re-index existing mails */
|
2009-11-28 13:06:21 +01:00
|
|
|
|
|
|
|
/* options for querying */
|
2009-11-28 19:55:50 +01:00
|
|
|
gboolean xquery; /* give the Xapian query instead of
|
2009-11-28 15:48:50 +01:00
|
|
|
search results */
|
2009-11-28 19:55:50 +01:00
|
|
|
const char *fields; /* fields to show in output */
|
2009-11-28 13:06:21 +01:00
|
|
|
|
2009-11-28 19:55:50 +01:00
|
|
|
const char *sortfield_str; /* field to sort by (string) */
|
2009-11-28 13:06:21 +01:00
|
|
|
|
|
|
|
/* FIXME: clean up this mess */
|
2009-11-28 19:55:50 +01:00
|
|
|
gboolean sortdir_descending ; /* sort descending? */
|
|
|
|
gboolean sortdir_ascending;
|
|
|
|
gboolean ascending_flag, descending_flag;
|
2009-11-28 13:06:21 +01:00
|
|
|
};
|
|
|
|
typedef struct _MuConfigOptions MuConfigOptions;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2009-11-29 23:04:16 +01:00
|
|
|
* set default values for the configuration options; when you call
|
|
|
|
* mu_config_init, you should also call mu_config_uninit when the data
|
|
|
|
* is no longer needed.
|
2009-11-28 13:06:21 +01:00
|
|
|
*
|
2009-11-29 23:04:16 +01:00
|
|
|
* @param opts options
|
2009-11-28 13:06:21 +01:00
|
|
|
*/
|
2009-11-29 23:04:16 +01:00
|
|
|
void mu_config_init (MuConfigOptions *opts);
|
2009-11-28 13:06:21 +01:00
|
|
|
|
|
|
|
|
2009-11-29 23:04:16 +01:00
|
|
|
/**
|
|
|
|
* free the MuOptionsCOnfig structure; the the muhome and maildir
|
|
|
|
* members are heap-allocated, so must be freed.
|
|
|
|
*
|
|
|
|
* @param opts
|
|
|
|
*/
|
|
|
|
void mu_config_uninit (MuConfigOptions *opts);
|
|
|
|
|
2009-11-28 13:06:21 +01:00
|
|
|
/**
|
|
|
|
* get the general options option group
|
|
|
|
*
|
|
|
|
* @param opts the MuConfigOptions to fill from this option group
|
|
|
|
*
|
|
|
|
* @return a new option group; *DON'T* unref when added to an optioncontext
|
|
|
|
*/
|
|
|
|
GOptionGroup* mu_config_options_group_mu (MuConfigOptions *opts);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get the index-options option group
|
|
|
|
*
|
|
|
|
* @param opts the MuConfigOptions to fill from this option group
|
|
|
|
*
|
|
|
|
* @return a new option group; *DON'T* unref when added to an optioncontext
|
|
|
|
*/
|
|
|
|
GOptionGroup* mu_config_options_group_index (MuConfigOptions *opts);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get the query-options option group
|
|
|
|
*
|
|
|
|
* @param opts the MuConfigOptions to fill from this option group
|
|
|
|
*
|
|
|
|
* @return a new option group; *DON'T* unref when added to an optioncontext
|
|
|
|
*/
|
|
|
|
GOptionGroup* mu_config_options_group_query (MuConfigOptions *opts);
|
|
|
|
|
|
|
|
|
2009-11-29 23:04:16 +01:00
|
|
|
char* mu_config_expanded_mu_home (MuConfigOptions *opts);
|
|
|
|
|
2009-11-28 13:06:21 +01:00
|
|
|
#endif /*__MU_CONFIG_H__*/
|