Commit 19f006cd 19f006cd913e886c19e48aed683d19d512758d6f by Sergey Poznyakoff

Begin rewriting the docs.

* configure.ac: Configure doc hints.
* config/mailutils-config.c (main): Use mu_fprint_conf_option.
* mailbox/version.c (mu_conf_option): Change type.
(mu_fprint_conf_option): New function.
(mu_fprint_options): Use mu_fprint_conf_option.
(mu_print_options): Fix signature
(mu_check_option): Change return type.
* testsuite/lib/mailutils.exp (mu_version): Reflect changes in the
output produced by --show-config-options.

* include/mailutils/version.h (struct mu_conf_option): New data
type.
(mu_check_option): Change return type.
(mu_fprint_conf_option): New prototype.
* libargp/common.c (mu_common_argp): Rename --rcfile-* options
to --config-*. Retain old names for a while.

* doc/texinfo/Makefile.am (RENDITION_TEXI): New variable.
(check-format, check-refs, check-fixmes, check-unrevised)
(all-check-docs, check-docs): New rules.
* doc/texinfo/rendition.texi: New file.
* doc/texinfo/macros.texi: New file.
* doc/texinfo/mailutils.texi: Start rewriting
* doc/texinfo/programs.texi: Likewise.

* doc/texinfo/c-api.texi: Reformat.
* doc/texinfo/fdl.texi: Likewise.
* doc/texinfo/libmuauth.texi: Likewise.
* doc/texinfo/libsieve.texi: Likewise.
* doc/texinfo/mu-mh.texi: Likewise.
* doc/texinfo/sieve.texi: Likewise.

* doc/texinfo/gendocs_template: Rewrite.
1 parent 3f88df00
2008-09-21 Sergey Poznyakoff <gray@gnu.org.ua>
* configure.ac: Configure doc hints.
* config/mailutils-config.c (main): Use mu_fprint_conf_option.
* mailbox/version.c (mu_conf_option): Change type.
(mu_fprint_conf_option): New function.
(mu_fprint_options): Use mu_fprint_conf_option.
(mu_print_options): Fix signature
(mu_check_option): Change return type.
* testsuite/lib/mailutils.exp (mu_version): Reflect changes in the
output produced by --show-config-options.
* include/mailutils/version.h (struct mu_conf_option): New data
type.
(mu_check_option): Change return type.
(mu_fprint_conf_option): New prototype.
* libargp/common.c (mu_common_argp): Rename --rcfile-* options
to --config-*. Retain old names for a while.
* doc/texinfo/Makefile.am (RENDITION_TEXI): New variable.
(check-format, check-refs, check-fixmes, check-unrevised)
(all-check-docs, check-docs): New rules.
* doc/texinfo/rendition.texi: New file.
* doc/texinfo/macros.texi: New file.
* doc/texinfo/mailutils.texi: Start rewriting
* doc/texinfo/programs.texi: Likewise.
* doc/texinfo/c-api.texi: Reformat.
* doc/texinfo/fdl.texi: Likewise.
* doc/texinfo/libmuauth.texi: Likewise.
* doc/texinfo/libsieve.texi: Likewise.
* doc/texinfo/mu-mh.texi: Likewise.
* doc/texinfo/sieve.texi: Likewise.
* doc/texinfo/gendocs_template: Rewrite.
2008-08-24 Sergey Poznyakoff <gray@gnu.org.ua>
Fix testsuite to avoid spawning /bin/cp.
......
......@@ -276,11 +276,11 @@ main (int argc, char **argv)
for (i = 0; i < argc; i++)
{
const char *val = mu_check_option (argv[i]);
if (val)
const struct mu_conf_option *opt = mu_check_option (argv[i]);
if (opt)
{
found++;
printf ("%s\n", val);
mu_fprint_conf_option (stdout, opt);
}
}
return found == argc ? 0 : 1;
......
......@@ -1103,6 +1103,24 @@ dnl get sysconfdir expanded.
CPPFLAGS="$CPPFLAGS -DSYSCONFDIR=\\\"\$(sysconfdir)\\\""
# Doc hints.
# Select a rendition level:
# DISTRIB for stable releases (at most one dot in the version number)
# and maintenance releases (two dots, patchlevel < 50)
# PROOF for alpha releases.
# PUBLISH can only be required manually when running make in doc/
AC_SUBST(RENDITION)
case `echo $VERSION|sed 's/[[^.]]//g'` in
""|".") RENDITION=DISTRIB;;
"..") if test `echo $VERSION | sed 's/.*\.//'` -lt 50; then
RENDITION=DISTRIB
else
RENDITION=PROOF
fi;;
*) RENDITION=PROOF;;
esac
AC_CONFIG_COMMANDS([status],[
cat <<EOF
......
......@@ -28,6 +28,8 @@ INCFILES = \
sfrom.inc\
url-parse.inc
RENDITION_TEXI=rendition.texi macros.texi
mailutils_TEXINFOS = \
address.texi\
attribute.texi\
......@@ -70,12 +72,9 @@ mailutils_TEXINFOS = \
smtp.texi\
stream.texi\
url.texi\
$(RENDITION_TEXI)\
$(INCFILES)
muint_TEXINFOS = \
muint.texi\
mom.texi
## Fake configure into including srcdir to VPATH:
s=${srcdir}:${top_srcdir}/examples/
VPATH = $(s)
......@@ -89,9 +88,12 @@ MAINTAINERCLEANFILES=$(INCFILES)
clean-local:
rm -rf manual
# The rendering level is one of PUBLISH, DISTRIB or PROOF.
# Just call `make RENDITION=PROOF [target]' if you want PROOF rendition.
MAKEINFOFLAGS=-D$(RENDITION)
GENDOCS=gendocs.sh
TEXI2DVI=texi2dvi
MAKEINFOFLAGS=
TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
# Make sure you set TEXINPUTS.
# TEXINPUTS=/usr/share/texmf/pdftex/plain/misc/ is ok for most distributions
......@@ -114,3 +116,57 @@ untabify:
emacs -batch -l untabify.el $(info_TEXINFOS) $(mailutils_TEXINFOS)
final: untabify master-menu
# Checks
check-format:
@if test -n "`cat $(info_TEXINFOS) $(mailutils_TEXINFOS) |\
tr -d -c '\t'`"; then \
echo "Sources contain tabs; run make untabify"; \
false; \
fi
check-refs:
@for file in $(info_TEXINFOS) $(dico_TEXINFOS); \
do \
sed -e = $$file | \
sed -n 'N;/@FIXME-.*ref/{s/\(^[0-9][0-9]*\).*@FIXME-.*ref{\([^}]*\)}.*/'$$file':\1: \2/gp}'; \
done > $@-t; \
if [ -s $@-t ]; then \
echo "Unresolved cross-references:"; \
cat $@-t;\
rm $@-t; \
else \
rm -f $@-t; \
fi
check-fixmes:
@for file in $(info_TEXINFOS); \
do \
sed -e = $$file | \
sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/'$$file':\1: \2/gp}'; \
done > $@-t; \
if [ -s $@-t ]; then \
echo "Unresolved FIXMEs:"; \
cat $@-t; \
rm $@-t; \
false; \
else \
rm -f $@-t; \
fi
check-unrevised:
@grep -Hn @UNREVISED $(info_TEXINFOS) $(dico_TEXINFOS) > $@-t; \
if [ -s $@-t ]; then \
echo "Unrevised nodes:"; \
cat $@-t; \
rm $@-t; \
false;\
else \
rm $@-t; \
fi
all-check-docs: check-format check-refs check-fixmes check-unrevised
check-docs:
$(MAKE) -k all-check-docs
......
......@@ -16,49 +16,41 @@
@end menu
@node POP3
@comment node-name, next, previous, up
@section POP3
@cindex POP3
@include pop3.texi
@node IMAP4
@comment node-name, next, previous, up
@section IMAP4
@cindex IMAP4
@include imap4.texi
@node Mbox
@comment node-name, next, previous, up
@section Mbox
@cindex Mbox
@include mbox.texi
@node Mh
@comment node-name, next, previous, up
@section Mh
@cindex Mh
@include mh.texi
@node Maildir
@comment node-name, next, previous, up
@section Maildir
@cindex Maildir
@include maildir.texi
@node SMTP
@comment node-name, next, previous, up
@section SMTP
@cindex SMTP
@include smtp.texi
@node Sendmail
@comment node-name, next, previous, up
@section Sendmail
@cindex Sendmail
@include sendmail.texi
@node Parse822
@comment node-name, next, previous, up
@section Parse822
@cindex Parse822
@include parse822.texi
......
@setfilename fdl.info
@node GNU FDL
@appendix GNU Free Documentation License
@cindex FDL, GNU Free Documentation License
@center Version 1.2, November 2002
......
......@@ -34,7 +34,7 @@
</p>
<hr />
The manual for %%PACKAGE%% is available in the following formats:</p>
<p>The manual for %%PACKAGE%% is available in the following formats:</p>
<ul>
<li><a href="%%PACKAGE%%.html">HTML
......@@ -44,10 +44,10 @@ The manual for %%PACKAGE%% is available in the following formats:</p>
<li><a href="%%PACKAGE%%.html.gz">HTML compressed
(%%HTML_MONO_GZ_SIZE%%K gzipped characters)</a> - entirely on
one web page.</li>
<li><a href="%%PACKAGE%%_html_node.tar.gz">HTML compressed
<li><a href="%%PACKAGE%%.html_node.tar.gz">HTML compressed
(%%HTML_NODE_TGZ_SIZE%%K gzipped tar file)</a> -
with one web page per node.</li>
<li><a href="%%PACKAGE%%-info.tar.gz">Info document
<li><a href="%%PACKAGE%%.info.tar.gz">Info document
(%%INFO_TGZ_SIZE%%K characters gzipped tar file)</a>.</li>
<li><a href="%%PACKAGE%%.txt">ASCII text
(%%ASCII_SIZE%%K characters)</a>.</li>
......@@ -77,7 +77,9 @@ href="%%SCRIPTURL%%">%%SCRIPTNAME%%</a> script.)
<p>
Return to the <a href="/home.html">GNU Project home page</a>.
</p>
<p>
Return to <a href="/software/%%PACKAGE%%">GNU %%PACKAGE%% home page</a>.
</p>
<p>
Please send FSF &amp; GNU inquiries to
<a href="mailto:gnu@gnu.org"><em>gnu@gnu.org</em></a>.
......@@ -89,8 +91,8 @@ Please send broken links and other corrections (or suggestions) to
</p>
<p>
Copyright (C) 2004 Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111, USA
Copyright (C) 2005 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
<br />
Verbatim copying and distribution of this entire article is
permitted in any medium, provided this notice is preserved.
......
......@@ -216,7 +216,7 @@ credentials for accessing the database are taken from global variables
and @code{sql_db}. The SQL queries for retrieving user information
from global variables @code{sql_getpwnam_query} and
@code{sql_getpwuid_query}. The variable @code{sql_getpass_query} keeps
the query used for retrieving user's password. @xref{auth}, for
the query used for retrieving user's password. @FIXME-xref{auth}, for
information on command line options used to set these variables.
@end defvar
......
......@@ -484,7 +484,7 @@ follows:
int
_sieve_default_parse_error (void *unused,
const char *filename, int lineno,
const char *fmt, va_list ap)
const char *fmt, va_list ap)
@{
if (filename)
fprintf (stderr, "%s:%d: ", filename, lineno);
......
@macro xopindex{option,text}
@opindex \option\, --\option\ @r{option, \text\}
@end macro
......@@ -6,14 +6,9 @@
@finalout
@c %**end of header
@c This file has the new style title page commands.
@c Run `makeinfo' rather than `texinfo-format-buffer'.
@c smallbook
@c tex
@c \overfullrule=0pt
@c end tex
@include version.texi
@include macros.texi
@include rendition.texi
@c Combine indices.
@defcodeindex op
......@@ -23,7 +18,7 @@
@ifinfo
@dircategory Email
@direntry
* Mailutils: (mailutils). Utilities & library for mailboxes, protocols.
* Mailutils: (mailutils). GNU Mail Utilities.
@end direntry
@dircategory Individual utilities
@direntry
......@@ -45,7 +40,7 @@ Published by the Free Software Foundation,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA
Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004
Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004, 2008
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
......@@ -63,7 +58,7 @@ Software Foundation raise funds for GNU development.''
@titlepage
@title GNU Mailutils
@subtitle version @value{VERSION}, @value{UPDATED}
@author Alain Magloire et al.
@author Alain Magloire, Sergey Pozbyakoff et al.
@page
@vskip 0pt plus 1filll
@insertcopying
......@@ -74,14 +69,13 @@ Software Foundation raise funds for GNU development.''
@page
@contents
@node Top, Introduction, (dir), (dir)
@comment node-name, next, previous, up
@ifnottex
@node Top
@top GNU Mailutils
@ifinfo
@chapter GNU Mailutils
This edition of the @cite{GNU Mailutils Manual}, last updated @value{UPDATED},
documents GNU Mailutils Version @value{VERSION}.
@end ifinfo
This edition of the @cite{GNU Mailutils Manual}, last updated on
@value{UPDATED}, documents GNU Mailutils Version @value{VERSION}.
@end ifnottex
@menu
* Introduction:: Preliminary Information.
......@@ -89,12 +83,13 @@ documents GNU Mailutils Version @value{VERSION}.
* Libraries:: Mailutils Libraries.
* Sieve Language:: The Sieve Language.
* Reporting Bugs:: How to Report a Bug.
* News:: Getting News About @sc{gnu} Mailutils.
* News:: Getting News About GNU Mailutils.
* Acknowledgement:: Thanks and Credits.
Appendices
* References:: References.
* Usage Vars:: Configuring Help Summary
* GNU FDL:: This manual is under the GNU Free
Documentation License.
......@@ -136,18 +131,6 @@ Mailutils Programs
* mailutils-config:: Get the Information about the Mailutils Build.
Mailutils Configuration File
* common:: Options understood by most @sc{gnu} utilities.
* mailbox:: Specifies the mail spool location, and locking strategy.
* mailer:: Sets the mailer URL.
* address:: Specifies the default email address and domain.
* daemon:: Options common for daemon programs.
* auth:: Authentication-specific options.
* encryption:: Encryption options.
* logging:: Logging control options.
* sieve: sieve group. Sieve specific options
* config sample:: A sample configuration file.
@command{mail} --- Send and Receive Mail
......@@ -360,24 +343,60 @@ Preprocessor
@end detailmenu
@end menu
@node Introduction, Programs, Top, Top
@comment node-name, next, previous, up
@node Introduction
@chapter Introduction
@sc{gnu} Mailutils contains a series of useful mail clients, servers,
GNU Mailutils contains a series of useful mail clients, servers,
and libraries. These are the primary mail utilities of the GNU system.
Specifically, this package contains a POP3 server, an IMAP4 server,
and a Sieve mail filter. It also provides a POSIX `mailx' client,
and a collection of other tools. The central library is capable of
accessing different mailbox formats and mailers as well as off of
local or remote POP3 and IMAP4 servers.
and a collection of other tools. All utilities can manipulate the
mailboxes of various formats, both local, stored on the hard disk,
and remote, accessed via network protocols, such as POP3 or IMAP4.
The GNU Mailutils libraries supply a rich set of primitives for
handling electronic mail in programs written in C, C++ or Scheme.
This software is part of the GNU Project and belongs to the Free
Software Foundation. All libraries are licensed using the GNU LGPL.
The documentation is licensed under the GNU FDL, and everything
else is licensed using the GNU GPL.
@subheading Why use this package?
@menu
* Book Contents:: What this Book Contains
* History:: A bit of History
@end menu
@node Book Contents
@section What this Book Contains
@UNREVISED
@FIXME{This is more a plan on how the document should be structured,
than a description of its actual structure. However it is:}
This book addresses a wide audience of both system administrators
and users that aim to use Mailutils programs, and programmers who wish
to use Mailutils libraries in their programs. Given this audience,
the book is divided in three major parts.
The first part provides a detailed description of each Mailutils
utility, and advices on how to use them in various situations. This
part is intended for users and system administrators who are using
Mailutils programs. If you are not interested in programming using
Mailutils, this is the only part you need to read.
Subsequent parts address programmers.
The second part is a tutorial which provides an introduction to
programming techniques for writing mail applications using GNU
Mailutils.
Finally, the third part contains a complete Mailutils library
reference.
@node History
@section A bit of History, and why use this package?
@UNREVISED
This package started off to try and handle large mailbox files more
gracefully then current POP3 servers did. While it handles this task,
......@@ -386,14 +405,12 @@ without any real effort on your part. Also, if a new format is added
at a later date, your program will support that new format
automatically as soon as it is compiled against the new library.
@node Programs, Libraries, Introduction, Top
@comment node-name, next, previous, up
@node Programs
@chapter Mailutils Programs
@cindex Programs
@include programs.texi
@node Libraries, Sieve Language, Programs, Top
@comment node-name, next, previous, up
@node Libraries
@chapter Mailutils Libraries
@cindex Libraries
......@@ -404,46 +421,38 @@ automatically as soon as it is compiled against the new library.
* libsieve:: GNU Implementation of Sieve Mail Filtering.
@end menu
@node libmailbox, libmuauth, Libraries, Libraries
@comment node-name, next, previous, up
@node libmailbox
@section Framework
@cindex Framework
@include framework.texi
@node libmuauth, libmu_scm, libmailbox, Libraries
@comment node-name, next, previous, up
@node libmuauth
@section Authentication Library
@cindex Authentication Library
@cindex libmuauth
@include libmuauth.texi
@node libmu_scm, libsieve, libmuauth, Libraries
@comment node-name, next, previous, up
@node libmu_scm
@section Mailutils to Scheme Interface
@cindex Scheme
@cindex libmu_scm
@include libmu_scm.texi
@node libsieve, , libmu_scm, Libraries
@comment node-name, next, previous, up
@node libsieve
@section Sieve Library
@cindex Sieve Library
@cindex libsieve
@include libsieve.texi
@node Sieve Language, Reporting Bugs, Libraries, Top
@comment node-name, next, previous, up
@node Sieve Language
@chapter Sieve Language
@cindex Sieve Language
@include sieve.texi
@node Reporting Bugs, News, Sieve Language, Top
@comment node-name, next, previous, up
@node Reporting Bugs
@chapter Reporting Bugs
Email bug reports to @email{bug-mailutils@@gnu.org}.
Be sure to include the word ``mailutils'' somewhere
in the ``Subject:'' field.
As the purpose of bug reporting is to improve software, please be sure
to include maximum information when reporting a bug. The information
......@@ -458,19 +467,17 @@ needed is:
The archives of bug-mailutils mailing list are available from
@url{http://mail.gnu.org/@/mailman/@/listinfo/@/bug-mailutils}.
@node News, Acknowledgement, Reporting Bugs, Top
@comment node-name, next, previous, up
@chapter Getting News About @sc{gnu} Mailutils
@node News
@chapter Getting News About GNU Mailutils
The two places to look for any news regarding @sc{gnu} Mailutils are the
The two places to look for any news regarding GNU Mailutils are the
Mailutils homepage at @url{http://www.gnu.org/@/software/@/mailutils}, and the
project page at @url{http://savannah.gnu.org/@/projects/@/mailutils}.
The updated versions of this manual are available online from
@url{http://www.gnu.org/@/software/@/mailutils/@/manual}.
@node Acknowledgement, References, News, Top
@comment node-name, next, previous, up
@node Acknowledgement
@chapter Acknowledgement
In no particular order,
......@@ -500,8 +507,7 @@ Jordi Mallach @email{jordi@@sindominio.net}
Wojciech Polak @email{polak@@gnu.org}
@end itemize
@node References, GNU FDL, Acknowledgement, Top
@comment node-name, next, previous, up
@node References
@appendix References
@itemize @bullet
......@@ -619,12 +625,11 @@ Notifications}
@end itemize
@end itemize
@node GNU FDL, Function Index, References, Top
@comment node-name, next, previous, up
@include usage.texi
@include fdl.texi
@node Function Index, Variable Index, GNU FDL, Top
@comment node-name, next, previous, up
@node Function Index
@unnumbered Function Index
This is an alphabetical list of all Mailutils functions.
......@@ -632,25 +637,23 @@ This is an alphabetical list of all Mailutils functions.
@printindex fn
@page
@node Variable Index, Keyword Index, Function Index, Top
@node Variable Index
@unnumbered Variable Index
@printindex vr
@page
@node Keyword Index, Program Index, Variable Index, Top
@node Keyword Index
@unnumbered Keyword Index
@printindex ky
@page
@node Program Index, Concept Index, Keyword Index, Top
@comment node-name, next, previous, up
@node Program Index
@unnumbered Program Index
@printindex pg
@page
@node Concept Index, , Program Index, Top
@comment node-name, next, previous, up
@node Concept Index
@unnumbered Concept Index
This is a general index of all issues discussed in this manual
......
......@@ -324,7 +324,7 @@ aliases, like @option{--cc}, @option{--from}, etc.)
The argument to this option is a string of type specifications:
@multitable @columnfractions 0.20 0.80
@item B @tab Use basic regular expressions
@item B @tab Use basic regular expressions
@item E @tab Use extended regular expressions
@item I @tab Ignore case
@item C @tab Case sensitive
......
@c Let's use the concept of 'renditions' by Fra@,{c}ois Pinard
@c I extended it by adding a FIXME_FOOTNOTE variable, which controls
@c whether FIXME information should be placed in footnotes or
@c inlined.
@c ======================================================================
@c This document has three levels of rendition: PUBLISH, DISTRIB or PROOF,
@c as decided by @set symbols. The PUBLISH rendition does not show
@c notes or marks asking for revision. Most users will prefer having more
@c information, even if this information is not fully revised for adequacy,
@c so DISTRIB is the default for distributions. The PROOF rendition
@c show all marks to the point of ugliness, but is nevertheless useful to
@c those working on the manual itself.
@c ======================================================================
@c Set this symbol if you wish FIXMEs to appear in footnotes, instead
@c of being inserted into the text.
@c @set PROOF_FOOTNOTED
@ifclear PUBLISH
@ifclear DISTRIB
@ifclear PROOF
@set DISTRIB
@end ifclear
@end ifclear
@end ifclear
@ifset PUBLISH
@set RENDITION The book, version
@end ifset
@ifset DISTRIB
@set RENDITION FTP release, version
@end ifset
@ifset PROOF
@set RENDITION Proof reading version
@end ifset
@c Output marks for nodes needing revision, but not in PUBLISH rendition.
@macro UNREVISED
@ifclear PUBLISH
@quotation
(@emph{The information in this node may be obsolete or otherwise inaccurate.}
This message will disappear, once this node revised.)
@end quotation
@end ifclear
@end macro
@c Output various FIXME information only in PROOF rendition.
@macro FIXME{string}
@ifset PROOF
@ifset PROOF_FOOTNOTED
@footnote{@strong{FIXME:} \string\}
@end ifset
@ifclear PROOF_FOOTNOTED
@cartouche
@strong{<FIXME>} \string\ @strong{</>}
@end cartouche
@end ifclear
@end ifset
@end macro
@macro FIXME-ref{string}
@ifset PROOF
@strong{<REF>} \string\ @strong{</>}
@end ifset
@end macro
@macro FIXME-pxref{string}
@ifset PROOF
@strong{<PXREF>} \string\ @strong{</>}
@end ifset
@end macro
@macro FIXME-xref{string}
@ifset PROOF
@strong{<XREF>} \string\ @strong{</>}
@end ifset
@end macro
......@@ -392,7 +392,7 @@ If @var{filename} starts with a directory separator character
The @code{#searchpath} directive adds its argument to the list of
directories searched for loadable modules. It has the same effect
as @option{-L} command line switch used by @sc{gnu} sieve utility
(@pxref{sieve group}).
(@FIXME-pxref{sieve group}).
@node Require Statement
@section Require Statement
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -25,10 +25,17 @@
extern "C" {
#endif
struct mu_conf_option
{
char *name;
char *descr;
};
extern char *mu_license_text;
extern void mu_print_options (void);
extern void mu_fprint_options (FILE *fp);
extern const char *mu_check_option (char *name);
extern void mu_fprint_conf_option (FILE *fp, const struct mu_conf_option *opt);
extern const struct mu_conf_option *mu_check_option (char *name);
#ifdef __cplusplus
}
......
......@@ -58,16 +58,21 @@ static struct argp_option mu_common_argp_options[] =
N_("Show compilation options"), 0 },
{ "config-help", OPT_HELP_CONFIG, NULL, 0,
N_("Show configuration file summary"), 0 },
{ "no-user-rcfile", OPT_NO_USER_RCFILE, NULL, 0,
{ "no-user-config", OPT_NO_USER_RCFILE, NULL, 0,
N_("Do not load user configuration file"), 0 },
{ "no-site-rcfile", OPT_NO_SITE_RCFILE, NULL, 0,
{ "no-user-rcfile", 0, NULL, OPTION_ALIAS, NULL },
{ "no-site-config", OPT_NO_SITE_RCFILE, NULL, 0,
N_("Do not load site configuration file"), 0 },
{ "rcfile", OPT_RCFILE, N_("FILE"), 0,
{ "no-site-rcfile", 0, NULL, OPTION_ALIAS, NULL },
{ "config-file", OPT_RCFILE, N_("FILE"), 0,
N_("Load this configuration file"), 0, },
{ "rcfile-verbose", OPT_RCFILE_VERBOSE, NULL, 0,
{ "rcfile", 0, NULL, OPTION_ALIAS, NULL },
{ "config-verbose", OPT_RCFILE_VERBOSE, NULL, 0,
N_("Verbosely log parsing of the configuration files"), 0 },
{ "rcfile-lint", OPT_RCFILE_LINT, NULL, 0,
{ "rcfile-verbose", 0, NULL, OPTION_ALIAS, NULL },
{ "config-lint", OPT_RCFILE_LINT, NULL, 0,
N_("Check configuration file syntax and exit"), 0 },
{ "rcfile-lint", 0, NULL, OPTION_ALIAS, NULL },
{ NULL, 0, NULL, 0, NULL, 0 }
};
......
......@@ -21,6 +21,7 @@
#endif
#include <mailutils/nls.h>
#include <mailutils/version.h>
#include <stdio.h>
#include <string.h>
......@@ -42,121 +43,130 @@ char *mu_license_text =
"\n"
);
static char *mu_conf_option[] = {
"VERSION=" VERSION,
static struct mu_conf_option mu_conf_option[] = {
{ "VERSION=" VERSION, N_("Version of this package") },
#ifdef USE_LIBPAM
"USE_LIBPAM",
{ "USE_LIBPAM", N_("PAM support") },
#endif
#ifdef HAVE_LIBLTDL
"HAVE_LIBLTDL",
{ "HAVE_LIBLTDL", N_("a portable `dlopen' wrapper library") },
#endif
#ifdef WITH_BDB2
"WITH_BDB2",
{ "WITH_BDB2", N_("Berkeley DB v. 2") },
#endif
#ifdef WITH_NDBM
"WITH_NDBM",
{ "WITH_NDBM", },
#endif
#ifdef WITH_OLD_DBM
"WITH_OLD_DBM",
{ "WITH_OLD_DBM", N_("Old DBM support") },
#endif
#ifdef WITH_GDBM
"WITH_GDBM",
{ "WITH_GDBM", N_("GNU DBM") },
#endif
#ifdef WITH_GNUTLS
"WITH_GNUTLS",
{ "WITH_GNUTLS", N_("TLS support using GNU TLS") },
#endif
#ifdef WITH_GSASL
"WITH_GSASL",
{ "WITH_GSASL", N_("SASL support using GNU SASL") },
#endif
#ifdef WITH_GSSAPI
"WITH_GSSAPI",
{ "WITH_GSSAPI", N_("GSSAPI support") },
#endif
#ifdef WITH_GUILE
"WITH_GUILE",
{ "WITH_GUILE", N_("Support for Guile as extension language") },
#endif
#ifdef WITH_PTHREAD
"WITH_PTHREAD",
{ "WITH_PTHREAD", N_("Support for POSIX threads") },
#endif
#ifdef WITH_READLINE
"WITH_READLINE",
{ "WITH_READLINE", N_("GNU Readline") },
#endif
#ifdef HAVE_MYSQL
"HAVE_MYSQL",
{ "HAVE_MYSQL", N_("MySQL") },
#endif
#ifdef HAVE_PGSQL
"HAVE_PGSQL",
{ "HAVE_PGSQL", N_("PostgreSQL") },
#endif
#ifdef WITH_LDAP
"WITH_LDAP",
{ "WITH_LDAP", },
#endif
#ifdef ENABLE_VIRTUAL_DOMAINS
"ENABLE_VIRTUAL_DOMAINS",
{ "ENABLE_VIRTUAL_DOMAINS", N_("Support for virtual mail domains") },
#endif
#ifdef ENABLE_IMAP
"ENABLE_IMAP",
{ "ENABLE_IMAP", N_("IMAP4D protocol support") },
#endif
#ifdef ENABLE_POP
"ENABLE_POP",
{ "ENABLE_POP", N_("POP3D protocol support") },
#endif
#ifdef ENABLE_MH
"ENABLE_MH",
{ "ENABLE_MH", N_("MH mail storage support") },
#endif
#ifdef ENABLE_MAILDIR
"ENABLE_MAILDIR",
{ "ENABLE_MAILDIR", N_("Maildir mail storage support") },
#endif
#ifdef ENABLE_SMTP
"ENABLE_SMTP",
{ "ENABLE_SMTP", N_("SMTP protocol support") },
#endif
#ifdef ENABLE_SENDMAIL
"ENABLE_SENDMAIL",
{ "ENABLE_SENDMAIL", N_("Sendmail command line interface support")},
#endif
#ifdef ENABLE_NNTP
"ENABLE_NNTP",
{ "ENABLE_NNTP", N_("NNTP protocol support") },
#endif
#ifdef ENABLE_RADIUS
"ENABLE_RADIUS",
{ "ENABLE_RADIUS", N_("RADIUS protocol support") },
#endif
#ifdef WITH_INCLUDED_LIBINTL
"WITH_INCLUDED_LIBINTL",
{ "WITH_INCLUDED_LIBINTL", N_("GNU libintl compiled in") },
#endif
NULL
{ NULL }
};
void
mu_fprint_conf_option (FILE *fp, const struct mu_conf_option *opt)
{
fprintf (fp, "%s", opt->name);
if (opt->descr)
fprintf (fp, "\t- %s", _(opt->descr));
fputc('\n', fp);
}
void
mu_fprint_options (FILE *fp)
{
int i;
for (i = 0; mu_conf_option[i]; i++)
fprintf (fp, "%s\n", mu_conf_option[i]);
for (i = 0; mu_conf_option[i].name; i++)
mu_fprint_conf_option (fp, mu_conf_option + i);
}
void
mu_print_options (FILE *fp)
mu_print_options ()
{
mu_fprint_options (stdout);
}
const char *
const struct mu_conf_option *
mu_check_option (char *name)
{
int i;
for (i = 0; mu_conf_option[i]; i++)
for (i = 0; mu_conf_option[i].name; i++)
{
int len;
char *q, *p = strchr (mu_conf_option[i], '=');
char *q, *p = strchr (mu_conf_option[i].name, '=');
if (p)
len = p - mu_conf_option[i];
len = p - mu_conf_option[i].name;
else
len = strlen (mu_conf_option[i]);
len = strlen (mu_conf_option[i].name);
if (strncasecmp (mu_conf_option[i], name, len) == 0)
return mu_conf_option[i];
else if ((q = strchr (mu_conf_option[i], '_')) != NULL
if (strncasecmp (mu_conf_option[i].name, name, len) == 0)
return &mu_conf_option[i];
else if ((q = strchr (mu_conf_option[i].name, '_')) != NULL
&& strncasecmp (q + 1, name,
len - (q - mu_conf_option[i]) - 1) == 0)
return mu_conf_option[i];
len - (q - mu_conf_option[i].name) - 1) == 0)
return &mu_conf_option[i];
}
return NULL;
}
......
......@@ -370,12 +370,13 @@ proc mu_version {} {
}
set output [remote_exec host "$MU_TOOL --show-config-options"]
set flg [split [lindex $output 1]]
set flg [split [lindex $output 1] "\n"]
for {set i 0} {$i < [llength $flg]} {incr i} {
if [regexp "(.*)=(.*)" [lindex $flg $i] var name value] {
regsub "(\t.*)?\r" [lindex $flg $i] "" string
if [regexp "(.*)=(.*)" $string var name value] {
set MU_CAPABILITY($name) $value
} else {
set MU_CAPABILITY([lindex $flg $i]) 1
} elseif {$string != ""} {
set MU_CAPABILITY($string) 1
}
}
if [info exists MU_CAPABILITY(VERSION)] {
......