* mu-config.h: fix indentation
This commit is contained in:
132
src/mu-config.h
132
src/mu-config.h
@ -1,5 +1,7 @@
|
|||||||
|
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** 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
|
** under the terms of the GNU General Public License as published by the
|
||||||
@ -27,6 +29,7 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/* output formats for 'mu find' */
|
||||||
#define MU_CONFIG_FORMAT_PLAIN "plain" /* plain text output */
|
#define MU_CONFIG_FORMAT_PLAIN "plain" /* plain text output */
|
||||||
#define MU_CONFIG_FORMAT_LINKS "links" /* output as symlinks */
|
#define MU_CONFIG_FORMAT_LINKS "links" /* output as symlinks */
|
||||||
#define MU_CONFIG_FORMAT_XML "xml" /* output xml */
|
#define MU_CONFIG_FORMAT_XML "xml" /* output xml */
|
||||||
@ -34,25 +37,25 @@ G_BEGIN_DECLS
|
|||||||
#define MU_CONFIG_FORMAT_SEXP "sexp" /* output sexps */
|
#define MU_CONFIG_FORMAT_SEXP "sexp" /* output sexps */
|
||||||
#define MU_CONFIG_FORMAT_XQUERY "xquery" /* output the xapian query */
|
#define MU_CONFIG_FORMAT_XQUERY "xquery" /* output the xapian query */
|
||||||
|
|
||||||
/* for cfind */
|
/* output formats for 'mu cfind' */
|
||||||
#define MU_CONFIG_FORMAT_MUTT_ALIAS "mutt-alias" /* mutt alias style */
|
#define MU_CONFIG_FORMAT_MUTT_ALIAS "mutt-alias" /* mutt alias style */
|
||||||
#define MU_CONFIG_FORMAT_MUTT_AB "mutt-ab" /* mutt ext addr book */
|
#define MU_CONFIG_FORMAT_MUTT_AB "mutt-ab" /* mutt ext addr book */
|
||||||
#define MU_CONFIG_FORMAT_WL "wl" /* Wanderlust address-book */
|
#define MU_CONFIG_FORMAT_WL "wl" /* Wanderlust abook */
|
||||||
#define MU_CONFIG_FORMAT_CSV "csv" /* comma-sep'd values */
|
#define MU_CONFIG_FORMAT_CSV "csv" /* comma-sep'd values */
|
||||||
#define MU_CONFIG_FORMAT_ORG_CONTACT "org-contact" /* org-contact */
|
#define MU_CONFIG_FORMAT_ORG_CONTACT "org-contact" /* org-contact */
|
||||||
#define MU_CONFIG_FORMAT_BBDB "bbdb" /* BBDB */
|
#define MU_CONFIG_FORMAT_BBDB "bbdb" /* BBDB */
|
||||||
|
|
||||||
enum _MuConfigCmd {
|
enum _MuConfigCmd {
|
||||||
MU_CONFIG_CMD_INDEX,
|
MU_CONFIG_CMD_INDEX,
|
||||||
MU_CONFIG_CMD_FIND,
|
MU_CONFIG_CMD_FIND,
|
||||||
MU_CONFIG_CMD_CLEANUP,
|
MU_CONFIG_CMD_CLEANUP,
|
||||||
MU_CONFIG_CMD_MKDIR,
|
MU_CONFIG_CMD_MKDIR,
|
||||||
MU_CONFIG_CMD_VIEW,
|
MU_CONFIG_CMD_VIEW,
|
||||||
MU_CONFIG_CMD_EXTRACT,
|
MU_CONFIG_CMD_EXTRACT,
|
||||||
MU_CONFIG_CMD_CFIND,
|
MU_CONFIG_CMD_CFIND,
|
||||||
MU_CONFIG_CMD_NONE,
|
MU_CONFIG_CMD_NONE,
|
||||||
|
|
||||||
MU_CONFIG_CMD_UNKNOWN
|
MU_CONFIG_CMD_UNKNOWN
|
||||||
};
|
};
|
||||||
typedef enum _MuConfigCmd MuConfigCmd;
|
typedef enum _MuConfigCmd MuConfigCmd;
|
||||||
|
|
||||||
@ -62,56 +65,57 @@ typedef enum _MuConfigCmd MuConfigCmd;
|
|||||||
|
|
||||||
struct _MuConfig {
|
struct _MuConfig {
|
||||||
|
|
||||||
MuConfigCmd cmd; /* the command, or
|
MuConfigCmd cmd; /* the command, or
|
||||||
* MU_CONFIG_CMD_NONE */
|
* MU_CONFIG_CMD_NONE */
|
||||||
const char *cmdstr; /* cmd string, for user info */
|
const char *cmdstr; /* cmd string, for user
|
||||||
|
* info */
|
||||||
|
|
||||||
/* general options */
|
/* general options */
|
||||||
gboolean quiet; /* don't give any output */
|
gboolean quiet; /* don't give any output */
|
||||||
gboolean debug; /* spew out debug info */
|
gboolean debug; /* spew out debug info */
|
||||||
char *muhome; /* the House of Mu */
|
char *muhome; /* the House of Mu */
|
||||||
gboolean version; /* request mu version */
|
gboolean version; /* request mu version */
|
||||||
gboolean log_stderr; /* log to stderr (not logfile) */
|
gboolean log_stderr; /* log to stderr (not logfile) */
|
||||||
gchar** params; /* parameters (for querying) */
|
gchar** params; /* parameters (for querying) */
|
||||||
|
|
||||||
/* options for indexing */
|
/* options for indexing */
|
||||||
char *maildir; /* where the mails are */
|
char *maildir; /* where the mails are */
|
||||||
gboolean nocleanup; /* don't cleanup deleted mails from db */
|
gboolean nocleanup; /* don't cleanup del'd mails from db */
|
||||||
gboolean reindex; /* re-index existing mails */
|
gboolean reindex; /* re-index existing mails */
|
||||||
gboolean rebuild; /* empty the database before indexing */
|
gboolean rebuild; /* empty the database before indexing */
|
||||||
gboolean autoupgrade; /* automatically upgrade db
|
gboolean autoupgrade; /* automatically upgrade db
|
||||||
* when needed */
|
* when needed */
|
||||||
int xbatchsize; /* batchsize for xapian
|
int xbatchsize; /* batchsize for xapian
|
||||||
* commits, or 0 for
|
* commits, or 0 for
|
||||||
* default */
|
* default */
|
||||||
int max_msg_size; /* maximum size for message files */
|
int max_msg_size; /* maximum size for message files */
|
||||||
|
|
||||||
/* options for querying */
|
/* options for querying */
|
||||||
gboolean xquery; /* (obsolete) give the Xapian
|
gboolean xquery; /* (obsolete) give the Xapian
|
||||||
query instead of search
|
query instead of search
|
||||||
results */
|
results */
|
||||||
char *fields; /* fields to show in output */
|
char *fields; /* fields to show in output */
|
||||||
char *sortfield; /* field to sort by (string) */
|
char *sortfield; /* field to sort by (string) */
|
||||||
gboolean descending; /* sort descending? */
|
gboolean descending; /* sort descending? */
|
||||||
unsigned summary_len; /* max # of lines of msg in summary */
|
unsigned summary_len; /* max # of lines of msg in summary */
|
||||||
char *bookmark; /* use bookmark */
|
char *bookmark; /* use bookmark */
|
||||||
|
char *formatstr; /* output type
|
||||||
|
* (plain*,links,xml,json,sexp) */
|
||||||
|
|
||||||
char *formatstr; /* output type
|
/* output to a maildir with symlinks */
|
||||||
* (plain*,links,xml,json,sexp) */
|
char *linksdir; /* maildir to output symlinks */
|
||||||
|
gboolean clearlinks; /* clear a linksdir before filling */
|
||||||
|
mode_t dirmode; /* mode for the created maildir */
|
||||||
|
|
||||||
/* output to a maildir with symlinks */
|
/* options for extracting parts */
|
||||||
char *linksdir; /* maildir to output symlinks */
|
gboolean *save_all; /* extract all parts */
|
||||||
gboolean clearlinks; /* clear a linksdir before filling */
|
gboolean *save_attachments; /* extract all attachment parts */
|
||||||
mode_t dirmode; /* mode for the created maildir */
|
gchar *parts; /* comma-sep'd list of parts
|
||||||
|
* to save / open */
|
||||||
/* options for extracting parts */
|
char *targetdir; /* where to save the attachments */
|
||||||
gboolean *save_all; /* extract all parts */
|
gboolean overwrite; /* should we overwrite same-named files */
|
||||||
gboolean *save_attachments; /* extract all attachment parts */
|
gboolean play; /* after saving, try to play
|
||||||
gchar *parts; /* comma-sep'd list of parts
|
* (open) the attmnt using xdgopen */
|
||||||
* to save / open */
|
|
||||||
char *targetdir; /* where to save the attachments */
|
|
||||||
gboolean overwrite; /* should we overwrite same-named files */
|
|
||||||
gboolean play; /* after saving, try to play (open) the attmnt */
|
|
||||||
};
|
};
|
||||||
typedef struct _MuConfig MuConfig;
|
typedef struct _MuConfig MuConfig;
|
||||||
|
|
||||||
@ -125,7 +129,7 @@ typedef struct _MuConfig MuConfig;
|
|||||||
* @param opts options
|
* @param opts options
|
||||||
*/
|
*/
|
||||||
MuConfig *mu_config_new (int *argcp, char ***argvp)
|
MuConfig *mu_config_new (int *argcp, char ***argvp)
|
||||||
G_GNUC_WARN_UNUSED_RESULT;
|
G_GNUC_WARN_UNUSED_RESULT;
|
||||||
/**
|
/**
|
||||||
* free the MuOptionsConfig structure; the the muhome and maildir
|
* free the MuOptionsConfig structure; the the muhome and maildir
|
||||||
* members are heap-allocated, so must be freed.
|
* members are heap-allocated, so must be freed.
|
||||||
@ -139,9 +143,9 @@ void mu_config_destroy (MuConfig *opts);
|
|||||||
*
|
*
|
||||||
* @param opts the commands/options
|
* @param opts the commands/options
|
||||||
*
|
*
|
||||||
* @return a value denoting the success/failure of the execution; MU_CONFIG_RETVAL_OK (0)
|
* @return a value denoting the success/failure of the execution;
|
||||||
* for success, non-zero for a failure. This is to used for the exit
|
* MU_CONFIG_RETVAL_OK (0) for success, non-zero for a failure. This
|
||||||
* code of the process
|
* is to used for the exit code of the process
|
||||||
*/
|
*/
|
||||||
MuExitCode mu_config_execute (MuConfig *opts);
|
MuExitCode mu_config_execute (MuConfig *opts);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user