Blame view

mailbox/version.c 5.42 KB
1
/* GNU Mailutils -- a suite of utilities for electronic mail
2
   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 3 of the License, or (at your option) any later version.

   This library 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
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General
   Public License along with this library; if not, write to the
   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301 USA */

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <mailutils/nls.h>
24
#include <mailutils/version.h>
25
#include <mailutils/cstr.h>
26 27 28
#include <stdio.h>
#include <string.h>

Sergey Poznyakoff authored
29 30
#include <confpaths.h>

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
char *mu_license_text =
 N_("   GNU Mailutils is free software; you can redistribute it and/or modify\n"
    "   it under the terms of the GNU General Public License as published by\n"
    "   the Free Software Foundation; either version 3 of the License, or\n"
    "   (at your option) any later version.\n"
    "\n"
    "   GNU Mailutils is distributed in the hope that it will be useful,\n"
    "   but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
    "   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
    "   GNU General Public License for more details.\n"
    "\n"
    "   You should have received a copy of the GNU General Public License along\n"
    "   with GNU Mailutils; if not, write to the Free Software Foundation,\n"
    "   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n"
    "\n"
    "\n"
);

49 50
static struct mu_conf_option mu_conf_option[] = {
  { "VERSION=" VERSION, N_("Version of this package") },
51 52
  { "SYSCONFDIR=" SYSCONFDIR, N_("System configuration directory") },
  { "MAILSPOOLDIR=" MU_PATH_MAILDIR, N_("Default mail spool directory") },
53
  { "SCHEME=" MU_DEFAULT_SCHEME, N_("Default mailbox type") },
54
  { "LOG_FACILITY=" LOG_FACILITY_STRING, N_("Default syslog facility") },
55
#ifdef USE_LIBPAM
56
  { "USE_LIBPAM", N_("PAM support") },
57 58
#endif
#ifdef HAVE_LIBLTDL
59
  { "HAVE_LIBLTDL", N_("a portable `dlopen' wrapper library") },
60 61
#endif
#ifdef WITH_BDB2
62
  { "WITH_BDB2", N_("Berkeley DB v. 2") },
63 64
#endif
#ifdef WITH_NDBM
65
  { "WITH_NDBM", },
66 67
#endif
#ifdef WITH_OLD_DBM
68
  { "WITH_OLD_DBM", N_("Old DBM support") },
69 70
#endif
#ifdef WITH_GDBM
71
  { "WITH_GDBM", N_("GNU DBM") },
72
#endif
73 74 75
#ifdef WITH_TOKYOCABINET
  { "WITH_TOKYOCABINET", N_("Tokyo Cabinet DBM") },
#endif
76
#ifdef WITH_GNUTLS
77
  { "WITH_GNUTLS", N_("TLS support using GNU TLS") },
78 79
#endif
#ifdef WITH_GSASL
80
  { "WITH_GSASL", N_("SASL support using GNU SASL") },
81 82
#endif
#ifdef WITH_GSSAPI
83
  { "WITH_GSSAPI", N_("GSSAPI support") },
84 85
#endif
#ifdef WITH_GUILE
86
  { "WITH_GUILE", N_("Support for Guile as extension language") },
87
#endif
88 89 90
#ifdef WITH_PYTHON
  { "WITH_PYTHON", N_("Support for Python as extension language") },
#endif
91
#ifdef WITH_PTHREAD
92
  { "WITH_PTHREAD", N_("Support for POSIX threads") },
93 94
#endif
#ifdef WITH_READLINE
95
  { "WITH_READLINE", N_("GNU Readline") },
96 97
#endif
#ifdef HAVE_MYSQL
98
  { "HAVE_MYSQL", N_("MySQL") },
99 100
#endif
#ifdef HAVE_PGSQL
101
  { "HAVE_PGSQL", N_("PostgreSQL") },
102
#endif
103
#ifdef WITH_LDAP
104
  { "WITH_LDAP", },
105
#endif
Sergey Poznyakoff authored
106 107 108
#ifdef WITH_LIBWRAP
  { "WITH_LIBWRAP", N_("Support for TCP wrappers") },
#endif
109
#ifdef ENABLE_VIRTUAL_DOMAINS
110
  { "ENABLE_VIRTUAL_DOMAINS", N_("Support for virtual mail domains") },
111 112
#endif
#ifdef ENABLE_IMAP
Sergey Poznyakoff authored
113
  { "ENABLE_IMAP", N_("IMAP4 protocol support") },
114 115
#endif
#ifdef ENABLE_POP
Sergey Poznyakoff authored
116
  { "ENABLE_POP",  N_("POP3 protocol support") },
117 118
#endif
#ifdef ENABLE_MH
119
  { "ENABLE_MH", N_("MH mail storage support") },
120 121
#endif
#ifdef ENABLE_MAILDIR
122
  { "ENABLE_MAILDIR", N_("Maildir mail storage support") },
123 124
#endif
#ifdef ENABLE_SMTP
125
  { "ENABLE_SMTP", N_("SMTP protocol support") },
126 127
#endif
#ifdef ENABLE_SENDMAIL
128
  { "ENABLE_SENDMAIL", N_("Sendmail command line interface support")},
129 130
#endif
#ifdef ENABLE_NNTP
131
  { "ENABLE_NNTP", N_("NNTP protocol support") },
132 133
#endif
#ifdef ENABLE_RADIUS
134
  { "ENABLE_RADIUS", N_("RADIUS protocol support") },
135 136
#endif
#ifdef WITH_INCLUDED_LIBINTL
137
  { "WITH_INCLUDED_LIBINTL", N_("GNU libintl compiled in") },
138
#endif
139
  { NULL }
140 141 142
};

void
Sergey Poznyakoff authored
143
mu_fprint_conf_option (FILE *fp, const struct mu_conf_option *opt, int verbose)
144 145
{
  fprintf (fp, "%s", opt->name);
Sergey Poznyakoff authored
146 147
  if (verbose && opt->descr)
    fprintf (fp, " \t- %s", _(opt->descr));
148 149 150 151
  fputc('\n', fp);
}

void
Sergey Poznyakoff authored
152
mu_fprint_options (FILE *fp, int verbose)
153 154 155
{
  int i;
  
156
  for (i = 0; mu_conf_option[i].name; i++)
Sergey Poznyakoff authored
157
    mu_fprint_conf_option (fp, mu_conf_option + i, verbose);
158 159 160
}

void
161
mu_print_options ()
162
{
Sergey Poznyakoff authored
163
  mu_fprint_options (stdout, 1);
164 165
}

166
const struct mu_conf_option *
167 168 169 170
mu_check_option (char *name)
{
  int i;
  
171
  for (i = 0; mu_conf_option[i].name; i++)
172 173
    {
      int len;
174
      char *q, *p = strchr (mu_conf_option[i].name, '=');
175
      if (p)
176
	len = p - mu_conf_option[i].name;
177
      else
178
	len = strlen (mu_conf_option[i].name);
179

180
      if (mu_c_strncasecmp (mu_conf_option[i].name, name, len) == 0)
181 182
	return &mu_conf_option[i];
      else if ((q = strchr (mu_conf_option[i].name, '_')) != NULL
183
	       && mu_c_strncasecmp (q + 1, name,
184 185
			       len - (q - mu_conf_option[i].name) - 1) == 0)
	return &mu_conf_option[i];
186 187 188 189
    }
  return NULL;
}